(run, messages, options)
| 235 | } |
| 236 | |
| 237 | function convertRun(run, messages, options) { |
| 238 | var nodes = function() { |
| 239 | return convertElements(run.children, messages, options); |
| 240 | }; |
| 241 | var paths = []; |
| 242 | if (run.isSmallCaps) { |
| 243 | paths.push(findHtmlPathForRunProperty("smallCaps")); |
| 244 | } |
| 245 | if (run.isStrikethrough) { |
| 246 | paths.push(findHtmlPathForRunProperty("strikethrough", "s")); |
| 247 | } |
| 248 | if (run.isUnderline) { |
| 249 | paths.push(findHtmlPathForRunProperty("underline")); |
| 250 | } |
| 251 | if (run.verticalAlignment === documents.verticalAlignment.subscript) { |
| 252 | paths.push(htmlPaths.element("sub", {}, {fresh: false})); |
| 253 | } |
| 254 | if (run.verticalAlignment === documents.verticalAlignment.superscript) { |
| 255 | paths.push(htmlPaths.element("sup", {}, {fresh: false})); |
| 256 | } |
| 257 | if (run.isItalic) { |
| 258 | paths.push(findHtmlPathForRunProperty("italic", "em")); |
| 259 | } |
| 260 | if (run.isBold) { |
| 261 | paths.push(findHtmlPathForRunProperty("bold", "strong")); |
| 262 | } |
| 263 | var stylePath = htmlPaths.empty; |
| 264 | var style = findStyle(run); |
| 265 | if (style) { |
| 266 | stylePath = style.to; |
| 267 | } else if (run.styleId) { |
| 268 | messages.push(unrecognisedStyleWarning("run", run)); |
| 269 | } |
| 270 | paths.push(stylePath); |
| 271 | |
| 272 | paths.forEach(function(path) { |
| 273 | nodes = path.wrap.bind(path, nodes); |
| 274 | }); |
| 275 | |
| 276 | return nodes(); |
| 277 | } |
| 278 | |
| 279 | function findHtmlPathForRunProperty(elementType, defaultTagName) { |
| 280 | var path = findHtmlPath({type: elementType}); |
nothing calls this directly
no test coverage detected