(node, originalText)
| 229 | // https://github.com/remarkjs/remark/issues/512 |
| 230 | // TODO[@fisker]: Use `node.value` directly when we update mdx to use latest remark |
| 231 | function getFencedCodeBlockValue(node, originalText) { |
| 232 | const { value } = node; |
| 233 | if ( |
| 234 | node.position.end.offset === originalText.length && |
| 235 | value.endsWith("\n") && |
| 236 | // Code block has no end mark |
| 237 | originalText.endsWith("\n") |
| 238 | ) { |
| 239 | return value.slice(0, -1); |
| 240 | } |
| 241 | return value; |
| 242 | } |
| 243 | |
| 244 | function mapAst(ast, handler) { |
| 245 | return (function preorder(node, index, parentStack) { |
no outgoing calls
no test coverage detected
searching dependent graphs…