1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-02 12:27:08 +01:00

fix: prevent broken XML in Word docs

This commit is contained in:
hacksalot
2018-02-06 08:22:31 -05:00
parent 7262578c81
commit 2bf5bb72cf
2 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,9 @@ Definition of the Markdown to WordProcessingML conversion routine.
*/
(function() {
var HTML5Tokenizer, _;
var HTML5Tokenizer, XML, _;
XML = require('xml-escape');
_ = require('underscore');
@ -51,7 +53,7 @@ Definition of the Markdown to WordProcessingML conversion routine.
style = is_bold ? '<w:b/>' : '';
style += is_italic ? '<w:i/>' : '';
style += is_link ? '<w:rStyle w:val="Hyperlink"/>' : '';
return final += (is_link ? '<w:hlink w:dest="' + link_url + '">' : '') + '<w:r><w:rPr>' + style + '</w:rPr><w:t>' + tok.chars + '</w:t></w:r>' + (is_link ? '</w:hlink>' : '');
return final += (is_link ? '<w:hlink w:dest="' + link_url + '">' : '') + '<w:r><w:rPr>' + style + '</w:rPr><w:t>' + XML(tok.chars) + '</w:t></w:r>' + (is_link ? '</w:hlink>' : '');
}
}
});