Skip to content

Fail to detect coding block when there is a space gap between <pre> <code>.Β #498

@Norlandz

Description

@Norlandz

The current implementation uses node.firstChild,
maybe using node.firstElementChild is better for cases where there is a space gap between <pre> <code>?

rules.fencedCodeBlock = {
  filter: function (node, options) {
    return (
      options.codeBlockStyle === 'fenced' &&
      node.nodeName === 'PRE' &&
      node.firstChild &&
      node.firstChild.nodeName === 'CODE'
    )
  },

https://github.com/mixmark-io/turndown/blob/master/src/commonmark-rules.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions