mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix #245 - 9
This commit is contained in:
parent
457c157ed5
commit
a8ed3c4205
2 changed files with 11 additions and 2 deletions
|
|
@ -447,3 +447,12 @@ x
|
||||||
<p><a href="">x</a></p>
|
<p><a href="">x</a></p>
|
||||||
<p>"</p>
|
<p>"</p>
|
||||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
||||||
|
|
||||||
|
32: Hex character entities must be limited to 6 characters
|
||||||
|
//- - - - - - - - -//
|
||||||
|
A
|
||||||
|
//- - - - - - - - -//
|
||||||
|
<p>&#x0000041;</p>
|
||||||
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -734,7 +734,7 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) {
|
||||||
if nnext < limit && nc == 'x' || nc == 'X' {
|
if nnext < limit && nc == 'x' || nc == 'X' {
|
||||||
start := nnext + 1
|
start := nnext + 1
|
||||||
i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsHexDecimal)
|
i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsHexDecimal)
|
||||||
if ok && i < limit && source[i] == ';' {
|
if ok && i < limit && source[i] == ';' && i-start < 7 {
|
||||||
v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 16, 32)
|
v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 16, 32)
|
||||||
d.RawWrite(writer, source[n:pos])
|
d.RawWrite(writer, source[n:pos])
|
||||||
n = i + 1
|
n = i + 1
|
||||||
|
|
@ -745,7 +745,7 @@ func (d *defaultWriter) Write(writer util.BufWriter, source []byte) {
|
||||||
} else if nc >= '0' && nc <= '9' {
|
} else if nc >= '0' && nc <= '9' {
|
||||||
start := nnext
|
start := nnext
|
||||||
i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsNumeric)
|
i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsNumeric)
|
||||||
if ok && i < limit && i-start < 8 && source[i] == ';' {
|
if ok && i < limit && i-start < 8 && source[i] == ';' && i-start < 7 {
|
||||||
v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 0, 32)
|
v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 0, 32)
|
||||||
d.RawWrite(writer, source[n:pos])
|
d.RawWrite(writer, source[n:pos])
|
||||||
n = i + 1
|
n = i + 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue