(tag, node, currentStyle)
| 196 | } |
| 197 | |
| 198 | function processInlineTag(tag, node, currentStyle) { |
| 199 | const styleToCheck = inlineTags[tag]; |
| 200 | if (styleToCheck) { |
| 201 | currentStyle = currentStyle.add(styleToCheck).toOrderedSet(); |
| 202 | } else if (node instanceof HTMLElement) { |
| 203 | const htmlElement = node; |
| 204 | currentStyle = currentStyle |
| 205 | .withMutations(style => { |
| 206 | if (htmlElement.style.fontWeight === 'bold') { |
| 207 | style.add('BOLD'); |
| 208 | } |
| 209 | |
| 210 | if (htmlElement.style.fontStyle === 'italic') { |
| 211 | style.add('ITALIC'); |
| 212 | } |
| 213 | |
| 214 | if (htmlElement.style.textDecoration === 'underline') { |
| 215 | style.add('UNDERLINE'); |
| 216 | } |
| 217 | |
| 218 | if (htmlElement.style.textDecoration === 'line-through') { |
| 219 | style.add('STRIKETHROUGH'); |
| 220 | } |
| 221 | }) |
| 222 | .toOrderedSet(); |
| 223 | } |
| 224 | return currentStyle; |
| 225 | } |
| 226 | |
| 227 | function baseProcessInlineTag(tag, node, inlineStyles = OrderedSet()) { |
| 228 | return processInlineTag(tag, node, inlineStyles); |
no outgoing calls
no test coverage detected
searching dependent graphs…