mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix #245 - 3
This commit is contained in:
parent
fad80b4f0c
commit
466482bf19
2 changed files with 11 additions and 0 deletions
|
|
@ -380,3 +380,10 @@ a* b c d *e*
|
|||
//- - - - - - - - -//
|
||||
<aaa >
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
25: code block starts with tab
|
||||
//- - - - - - - - -//
|
||||
x
|
||||
//- - - - - - - - -//
|
||||
<pre><code> x</code></pre>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ func (b *codeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context)
|
|||
node := ast.NewCodeBlock()
|
||||
reader.AdvanceAndSetPadding(pos, padding)
|
||||
_, segment = reader.PeekLine()
|
||||
// if code block line starts with a tab, keep a tab as it is.
|
||||
if segment.Padding != 0 {
|
||||
preserveLeadingTabInCodeBlock(&segment, reader, 0)
|
||||
}
|
||||
node.Lines().Append(segment)
|
||||
reader.Advance(segment.Len() - 1)
|
||||
return node, NoChildren
|
||||
|
|
|
|||
Loading…
Reference in a new issue