How to use the idyll-ast.getNodeName function in idyll-ast

To help you get started, we’ve selected a few idyll-ast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github idyll-lang / idyll / packages / idyll-compiler / src / processors / post.js View on Github external
function autoLinkifyHelper(node) {
  if(typeof node === 'string') {
    return hyperLinkifiedVersion(node); 
  } else if (['a', 'code', 'pre', 'equation'].indexOf(getNodeName(node).toLowerCase()) > -1){
    return node; 
  } else {
    return modifyChildren(node, autoLinkifyHelper); 
  }
}
github idyll-lang / idyll / packages / idyll-document / src / utils / index.js View on Github external
const tNode = node => {
    if (getType(node) === 'textnode') return node;

    let name = getNodeName(node);

    let attrs = getProperties(node);
    if (!attrs) {
      attrs = {};
    }
    const children = getChildren(node);
    return {
      component: name,
      ...attrConvert(attrs, node),
      children: children.map(tNode)
    };
  };