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
When using the C or C++ parser, the '%' character in a string is misinterpreted as a "placeholder".
This can be observed by trying to format "% + 10px". Syntect outputs <span class="constant other placeholder c">% + 10p</span>x instead of the expected % + 10px.
Complete example:
externcrate syntect;use syntect::util::{LinesWithEndings};use syntect::html::{ClassedHTMLGenerator,ClassStyle};fnmain(){let syntax_set = syntect::parsing::SyntaxSet::load_defaults_newlines();let syntax = syntax_set.find_syntax_by_extension("c++").unwrap();letmut h = ClassedHTMLGenerator::new_with_class_style(syntax,&syntax_set,ClassStyle::Spaced);for line inLinesWithEndings::from(r#""% + 10px""#){
h.parse_html_for_line_which_includes_newline(line).unwrap();}assert_eq!(h.finalize(),r#"<span class="source c++"><span class="string quoted double c"><span class="punctuation definition string begin c">"</span>% + 10px<span class="punctuation definition string end c">"</span></span></span>"#);}
The text was updated successfully, but these errors were encountered:
When using the C or C++ parser, the '%' character in a string is misinterpreted as a "placeholder".
This can be observed by trying to format
"% + 10px"
. Syntect outputs<span class="constant other placeholder c">% + 10p</span>x
instead of the expected% + 10px
.Complete example:
The text was updated successfully, but these errors were encountered: