mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-12-22 05:27:22 +00:00
fix: prevent broken XML in Word docs
This commit is contained in:
parent
7262578c81
commit
2bf5bb72cf
6
dist/utils/html-to-wpml.js
vendored
6
dist/utils/html-to-wpml.js
vendored
@ -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>' : '');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user