Tweak highlight name matching semantics, add doc comments

This commit is contained in:
Max Brunsfeld 2019-10-17 12:03:34 -07:00
parent b79295e1a0
commit 084406148b
3 changed files with 82 additions and 38 deletions

View file

@ -46,7 +46,7 @@ lazy_static! {
.collect()
);
static ref HTML_ATTRS: Vec<String> = HIGHLIGHTER
.highlight_names
.names()
.iter()
.map(|s| format!("class={}", s))
.collect();
@ -598,9 +598,7 @@ fn to_token_vector<'a>(
)?;
for event in events {
match event? {
HighlightEvent::HighlightStart(s) => {
highlights.push(HIGHLIGHTER.highlight_names[s.0].as_str())
}
HighlightEvent::HighlightStart(s) => highlights.push(HIGHLIGHTER.names()[s.0].as_str()),
HighlightEvent::HighlightEnd => {
highlights.pop();
}