Skip to content

Commit

Permalink
fix: handle number-only case
Browse files Browse the repository at this point in the history
  • Loading branch information
kermanx committed Apr 21, 2024
1 parent ae6e330 commit ba7bfe5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function markdownItLink(md: MarkdownIt) {
const hrefIndex = token.attrIndex('href')
const attr = token.attrs?.[hrefIndex]
const href = attr?.[1] ?? ''
if ('./#'.includes(href[0])) {
if ('./#'.includes(href[0]) || /^\d+$/.test(href)) {
token.tag = 'Link'
attr![0] = 'to'

Expand Down

0 comments on commit ba7bfe5

Please sign in to comment.