Fix #637 : Markdown footnotes (#700)

* Ensure footnotes classes generated are not filtered

pulldown-cmark add somes classes when footnotes html is generated. This commit ensure they are not filtered by html sanitizer

* Add some footnotes styling
This commit is contained in:
Wilfried OLLIVIER 2019-11-20 16:16:38 +01:00 committed by Ana Gelez
parent 7f296b2ef2
commit 3bd2305115
2 changed files with 12 additions and 0 deletions

View file

@ -481,3 +481,12 @@ input:checked ~ .cw-container > .cw-text {
margin: auto $horizontal-margin;
}
}
// Footnote related styles
.footnote-definition {
p {
font-size: smaller;
// Make sur the definition is inline with the label-definition
display: inline;
}
}

View file

@ -31,6 +31,9 @@ lazy_static! {
.add_tag_attributes("label", ["for"].iter())
.add_tag_attributes("input", ["type", "checked"].iter())
.add_allowed_classes("input", ["cw-checkbox"].iter())
// Related to https://github.com/Plume-org/Plume/issues/637
.add_allowed_classes("sup", ["footnote-reference", "footnote-definition-label"].iter())
.add_allowed_classes("div", ["footnote-definition"].iter())
.add_allowed_classes("span", ["cw-container", "cw-text"].iter())
.attribute_filter(|elem, att, val| match (elem, att) {
("input", "type") => Some("checkbox".into()),