File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1058,6 +1058,24 @@ The document[^1] text.
10581058 ) ;
10591059 }
10601060
1061+ #[ test]
1062+ fn extract_messages_backslashes ( ) {
1063+ // Demonstrate how a single backslash in the Markdown becomes
1064+ // a backslash-escaped backslash when we extract the text.
1065+ // This is consistent with the CommonMark spec:
1066+ // https://spec.commonmark.org/0.30/#backslash-escapes.
1067+ // However, it causes problems for LaTeX preprocessors:
1068+ // https://github.com/google/mdbook-i18n-helpers/issues/105.
1069+ assert_extract_messages (
1070+ r#"
1071+ $$
1072+ \sum_{n=1}^{\infty} 2^{-n} = 1
1073+ $$
1074+ "# ,
1075+ vec ! [ ( 2 , r#"$$ \\sum\_{n=1}^{\infty} 2^{-n} = 1 $$"# ) ] ,
1076+ )
1077+ }
1078+
10611079 #[ test]
10621080 fn test_is_comment_skip_directive_simple ( ) {
10631081 assert_eq ! (
You can’t perform that action at this time.
0 commit comments