Make implicit_header_references work with explicit header ids.

(Markdown reader.)
This commit is contained in:
John MacFarlane
2013-02-21 19:53:35 -08:00
parent 7a97369d01
commit 07e8cedf2b
4 changed files with 30 additions and 20 deletions
+3 -2
View File
@@ -61,8 +61,9 @@
,Header 2 ("implicit-header-references",[],[]) [Str "Implicit",Space,Str "header",Space,Str "references"]
,Header 3 ("my-header-1",[],[]) [Str "My",Space,Str "header"]
,Header 3 ("my-other-header",[],[]) [Str "My",Space,Str "other",Space,Str "header"]
,Para [Str "A",Space,Str "link",Space,Str "to",Space,Link [Str "My",Space,Str "header"] ("#my-header",""),Str "."]
,Para [Str "Another",Space,Str "link",Space,Str "to",Space,Link [Str "it"] ("#my-header",""),Str "."]
,Para [Str "A",Space,Str "link",Space,Str "to",Space,Link [Str "My",Space,Str "header"] ("#my-header-1",""),Str "."]
,Para [Str "Another",Space,Str "link",Space,Str "to",Space,Link [Str "it"] ("#my-header-1",""),Str "."]
,Para [Str "Link",Space,Str "to",Space,Link [Str "Explicit",Space,Str "header",Space,Str "attributes"] ("#foobar",""),Str "."]
,Para [Str "But",Space,Str "this",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "link",Space,Str "to",Space,Link [Str "My",Space,Str "other",Space,Str "header"] ("/foo",""),Str ",",Space,Str "since",Space,Str "the",Space,Str "reference",Space,Str "is",Space,Str "defined."]
,Header 2 ("foobar",["baz"],[("key","val")]) [Str "Explicit",Space,Str "header",Space,Str "attributes"]
,Header 2 ("line-blocks",[],[]) [Str "Line",Space,Str "blocks"]
+2
View File
@@ -144,6 +144,8 @@ A link to [My header].
Another link to [it][My header].
Link to [Explicit header attributes].
[my other header]: /foo
But this is not a link to [My other header], since the reference is defined.