mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix #245 - 4
This commit is contained in:
parent
f37563cfa8
commit
351308fb72
3 changed files with 16 additions and 2 deletions
|
|
@ -381,9 +381,17 @@ a* b c d *e*
|
|||
<aaa >
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
25: code block starts with tab
|
||||
25: Indented code blocks can start with tab
|
||||
//- - - - - - - - -//
|
||||
x
|
||||
//- - - - - - - - -//
|
||||
<pre><code> x</code></pre>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
26: NUL bytes must be replaced with U+FFFD
|
||||
OPTIONS: {"enableEscape": true}
|
||||
//- - - - - - - - -//
|
||||
hello\x00world
|
||||
//- - - - - - - - -//
|
||||
<p>hello\ufffdworld</p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
|
|
|||
|
|
@ -719,6 +719,12 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) {
|
|||
continue
|
||||
}
|
||||
}
|
||||
if c == '\x00' {
|
||||
d.RawWrite(writer, source[n:i])
|
||||
d.RawWrite(writer, []byte("\ufffd"))
|
||||
n = i + 1
|
||||
continue
|
||||
}
|
||||
if c == '&' {
|
||||
pos := i
|
||||
next := i + 1
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ Diff
|
|||
if err := m.Convert([]byte(source(&testCase)), &out, opts...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ok = bytes.Equal(bytes.TrimSpace(out.Bytes()), []byte(expected(&testCase)))
|
||||
ok = bytes.Equal(bytes.TrimSpace(out.Bytes()), bytes.TrimSpace([]byte(expected(&testCase))))
|
||||
}
|
||||
|
||||
type diffType int
|
||||
|
|
|
|||
Loading…
Reference in a new issue