mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fixed #27
This commit is contained in:
parent
16b69522a4
commit
ea8789f650
2 changed files with 6 additions and 5 deletions
|
|
@ -15,6 +15,8 @@
|
||||||
## Title6 ## {#id_6 .class6 attr6=value6}
|
## Title6 ## {#id_6 .class6 attr6=value6}
|
||||||
|
|
||||||
## Title7 ## {#id_7 attr7="value \"7"}
|
## Title7 ## {#id_7 attr7="value \"7"}
|
||||||
|
|
||||||
|
## Title8 {#id .className attrName=attrValue class="class1 class2"}
|
||||||
//- - - - - - - - -//
|
//- - - - - - - - -//
|
||||||
<h2 id="title-0">Title 0</h2>
|
<h2 id="title-0">Title 0</h2>
|
||||||
<h2 id="id_1" class="class-1">Title1</h2>
|
<h2 id="id_1" class="class-1">Title1</h2>
|
||||||
|
|
@ -24,4 +26,5 @@
|
||||||
<h2 id="id_5" attr5="value5">Title5</h2>
|
<h2 id="id_5" attr5="value5">Title5</h2>
|
||||||
<h2 id="id_6" class="class6" attr6="value6">Title6</h2>
|
<h2 id="id_6" class="class6" attr6="value6">Title6</h2>
|
||||||
<h2 id="id_7" attr7="value "7">Title7</h2>
|
<h2 id="id_7" attr7="value "7">Title7</h2>
|
||||||
|
<h2 id="id" class="className class1 class2" attrName="attrValue">Title8</h2>
|
||||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,9 @@ func ParseAttributes(reader text.Reader) (Attributes, bool) {
|
||||||
}
|
}
|
||||||
if bytes.Equal(attr.Name, attrNameClass) {
|
if bytes.Equal(attr.Name, attrNameClass) {
|
||||||
if !attrs.findUpdate(attrNameClass, func(v interface{}) interface{} {
|
if !attrs.findUpdate(attrNameClass, func(v interface{}) interface{} {
|
||||||
var ret interface{}
|
ret := make([]byte, 0, len(v.([]byte))+1+len(attr.Value.([]byte)))
|
||||||
if ret, ok = v.([][]byte); !ok {
|
ret = append(ret, v.([]byte)...)
|
||||||
ret = [][]byte{v.([]byte)}
|
return append(append(ret, ' '), attr.Value.([]byte)...)
|
||||||
}
|
|
||||||
return append(ret.([][]byte), attr.Value.([]byte))
|
|
||||||
}) {
|
}) {
|
||||||
attrs = append(attrs, attr)
|
attrs = append(attrs, attr)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue