Skip to content

Commit

Permalink
Support inline code markdown feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tpmai22 committed Oct 1, 2021
1 parent 2a782be commit fdb4b9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -36,6 +36,7 @@ const heading1Markdown = (content: string): string => { //heading1Markdown() tak
return content.split(/[\r?\n\r?\n]/g)
.map((line) =>
line
.replace (/(^`)(.+?(?=`))(`$)/gim, '<code>$2</code>')
.replace(/-{3}/gim, '<hr>')
.replace(/(^(?!<)[^#](.*$))/gim, '<p>$1</p>')
.replace(/^##\s(.*$)/gim, "<h2>$1</h2>")
Expand Down
2 changes: 1 addition & 1 deletion tester.md
Expand Up @@ -7,4 +7,4 @@ also regular.

---

```a = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1```
` code this is code pls do something `

0 comments on commit fdb4b9d

Please sign in to comment.