MCPcopy Index your code
hub / github.com/TruthHun/BookStack / readStyle

Function readStyle

static/word2md/mammoth.browser.js:896–913  ·  view source on GitHub ↗
(element, styleTagName, styleType, findStyleById)

Source from the content-addressed store, hash-verified

894 }
895
896 function readStyle(element, styleTagName, styleType, findStyleById) {
897 var messages = [];
898 var styleElement = element.first(styleTagName);
899 var styleId = null;
900 var name = null;
901 if (styleElement) {
902 styleId = styleElement.attributes["w:val"];
903 if (styleId) {
904 var style = findStyleById(styleId);
905 if (style) {
906 name = style.name;
907 } else {
908 messages.push(undefinedStyleWarning(styleType, styleId));
909 }
910 }
911 }
912 return elementResultWithMessages({styleId: styleId, name: name}, messages);
913 }
914
915 var unknownComplexField = {type: "unknown"};
916

Callers 3

readParagraphStyleFunction · 0.70
readRunStyleFunction · 0.70
readTableStyleFunction · 0.70

Calls 3

undefinedStyleWarningFunction · 0.70
parseStringFunction · 0.70

Tested by

no test coverage detected