You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Headings can have a custom HTML ID and classes. This let's you maintain the same ID even if you change the heading's text, it also let's you add multiple classes in the heading.
227
+
228
+
Example:
229
+
```md
230
+
# Example heading { #first .class1 .class2 }
231
+
```
232
+
233
+
This makes the level 1 heading with the content `Example heading`, ID `first`, and classes `class1` and `class2`. Note that the attributes should be space-separated.
234
+
235
+
More information can be found in the [heading attrs spec page](https://github.com/raphlinus/pulldown-cmark/blob/master/specs/heading_attrs.txt).
let no_headers = get_doc_ref("first/no-headers.html");
755
756
let duplicate_headers_1 = get_doc_ref("first/duplicate-headers.html#header-text-1");
756
757
let conclusion = get_doc_ref("conclusion.html#conclusion");
758
+
let heading_attrs = get_doc_ref("first/heading-attributes.html#both");
757
759
758
760
let bodyidx = &index["index"]["index"]["body"]["root"];
759
761
let textidx = &bodyidx["t"]["e"]["x"]["t"];
@@ -766,7 +768,7 @@ mod search {
766
768
assert_eq!(docs[&some_section]["body"],"");
767
769
assert_eq!(
768
770
docs[&summary]["body"],
769
-
"Dummy Book Introduction First Chapter Nested Chapter Includes Recursive Markdown Unicode No Headers Duplicate Headers Second Chapter Nested Chapter Conclusion"
771
+
"Dummy Book Introduction First Chapter Nested Chapter Includes Recursive Markdown Unicode No Headers Duplicate Headers Heading Attributes Second Chapter Nested Chapter Conclusion"
0 commit comments