1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-09 23:37:09 +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

@ -5,6 +5,7 @@ Definition of the Markdown to WordProcessingML conversion routine.
###
XML = require 'xml-escape'
_ = require 'underscore'
HTML5Tokenizer = require 'simple-html-tokenizer'
@ -44,6 +45,6 @@ module.exports = ( html ) ->
style += if is_link then '<w:rStyle w:val="Hyperlink"/>' else ''
final +=
(if is_link then ('<w:hlink w:dest="' + link_url + '">') else '') +
'<w:r><w:rPr>' + style + '</w:rPr><w:t>' + tok.chars +
'<w:r><w:rPr>' + style + '</w:rPr><w:t>' + XML(tok.chars) +
'</w:t></w:r>' + (if is_link then '</w:hlink>' else '')
final