From be9957bddc1e1edac2375b6b945ab4d07f6198d2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 12 Aug 2017 20:25:08 -0700 Subject: Escape MetaString values (as added with --metadata flag). Previously they would be transmitted to the template without any escaping. Note that `--M title='*foo*'` yields a different result from --- title: *foo* --- In the latter case, we have emphasis; in the former case, just a string with literal asterisks (which will be escaped in formats, like Markdown, that require it). Closes #3792. --- test/command/3792.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/command/3792.md (limited to 'test') diff --git a/test/command/3792.md b/test/command/3792.md new file mode 100644 index 000000000..7c76afee7 --- /dev/null +++ b/test/command/3792.md @@ -0,0 +1,13 @@ +Make sure metadata values are treated as strings, +and properly escaped. + +``` +% pandoc -t markdown -s -M title=" *that*" +ok +^D +--- +title: '\ \*that\*' +--- + +ok +``` -- cgit v1.2.3