(tokens, options, prevType)
| 68 | } |
| 69 | |
| 70 | function transformInline(tokens, options, prevType) { |
| 71 | let capitalize = options.capitalizeTitles && prevType == "heading_open" |
| 72 | let result = [] |
| 73 | for (let i = 0; i < tokens.length; i++) { |
| 74 | let tok = tokens[i], type = tok.type |
| 75 | if (type == "meta_if_close" || (options.index === false && type == "meta_index")) { |
| 76 | // Drop |
| 77 | } else if (type == "meta_if_open") { |
| 78 | i = handleIf(tokens, i, options) |
| 79 | } else { |
| 80 | if (type == "text" && /[\'\"]/.test(tok.content)) tok.content = smartQuotes(tokens, i, options.texQuotes, options.moveQuotes) |
| 81 | if (capitalize) tok.content = capitalizeTitle(tok.content) |
| 82 | result.push(tok) |
| 83 | } |
| 84 | } |
| 85 | return result |
| 86 | } |
| 87 | |
| 88 | function nextTag(tokens, i) { |
| 89 | for (let j = i + 1; j < tokens.length; j++) if (tokens[j].tag) return tokens[j]; |
no test coverage detected