MCPcopy Create free account
hub / github.com/TruthHun/BookStack / convertDocumentToHtml

Function convertDocumentToHtml

static/word2md/mammoth.browser.js:2400–2412  ·  view source on GitHub ↗
(documentResult, options)

Source from the content-addressed store, hash-verified

2398}
2399
2400function convertDocumentToHtml(documentResult, options) {
2401 var styleMapResult = parseStyleMap(options.readStyleMap());
2402 var parsedOptions = _.extend({}, options, {
2403 styleMap: styleMapResult.value
2404 });
2405 var documentConverter = new DocumentConverter(parsedOptions);
2406
2407 return documentResult.flatMapThen(function(document) {
2408 return styleMapResult.flatMapThen(function(styleMap) {
2409 return documentConverter.convertToHtml(document);
2410 });
2411 });
2412}
2413
2414function parseStyleMap(styleMap) {
2415 return Result.combine((styleMap || []).map(readStyle))

Callers 1

convertFunction · 0.70

Calls 2

extendMethod · 0.80
parseStyleMapFunction · 0.70

Tested by

no test coverage detected