Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix/pound in text#78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromfix/pound-in-text
Apr 3, 2021
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
fix hash issue
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
@ShMcK
ShMcK committedApr 3, 2021
commited7c68f5f6e3c51069144be96f3b4eb8f23aacf5
6 changes: 3 additions & 3 deletionssrc/utils/parse.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,9 +22,9 @@ export function parseMdContent (md: string): TutorialFrame | never {

const lines = md.split('\n')

// Split themultiple parts - This way enables the creator to use 4/5 level headers inside the content.
// Split theheader based sections
lines.forEach((line, index) => {
if (line.match(/#{1,3}\s/) || index === lines.length - 1) {
if (line.match(/^#{1,5}\s/) || index === lines.length - 1) {
if (start !== -1) {
parts.push(lines.slice(start, index).join('\n'))
start = index
Expand All@@ -44,6 +44,7 @@ export function parseMdContent (md: string): TutorialFrame | never {

// Capture summary
const summaryMatch = parts.shift().match(R.summary)

if (summaryMatch.groups.tutorialTitle) {
mdContent.summary.title = summaryMatch.groups.tutorialTitle.trim()
}
Expand All@@ -57,7 +58,6 @@ export function parseMdContent (md: string): TutorialFrame | never {
parts.forEach((section: string) => {
// match level
const levelMatch: RegExpMatchArray | null = section.match(R.level)

if (levelMatch && levelMatch.groups) {
const levelId = levelMatch.groups.levelId.replace('.', '')
current = {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp