Skip to content

Commit

Permalink
fix: lists are not eligible in simple inline mode
Browse files Browse the repository at this point in the history
Fixes #466
  • Loading branch information
quantizor committed Feb 1, 2023
1 parent 895c2b7 commit b7c9481
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions index.compiler.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,24 @@ print("hello world")
</div>
`)
})

it('#466 list-like syntax inside link regression test', () => {
render(
compiler(
'Hello, I think that [6. Markdown](http://daringfireball.net/projects/markdown/) lets you write content in a really natural way.'
)
)

expect(root.innerHTML).toMatchInlineSnapshot(`
<span>
Hello, I think that
<a href="http://daringfireball.net/projects/markdown/">
6. Markdown
</a>
lets you write content in a really natural way.
</span>
`)
})
})

describe('horizontal rules', () => {
Expand Down
2 changes: 1 addition & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function generateListRule(h: any, type: LIST_TYPE) {
// in which case we can parse with inline scope, but need to allow
// nested lists inside this inline scope.
const isStartOfLine = LIST_LOOKBEHIND_R.exec(prevCapture)
const isListBlock = state._list || !state._inline
const isListBlock = state._list || (!state._inline && !state._simple)

if (isStartOfLine && isListBlock) {
source = isStartOfLine[1] + source
Expand Down

0 comments on commit b7c9481

Please sign in to comment.