Ivan Voischev

Results 53 comments of Ivan Voischev

But i think that a distant future. Before we need stable API in core module ;)

we need more time and cases to separate api to module. You can not cite a single query to whom it would be necessary to. So... that a distant future

"Flexible AST" — **does not mean that it should be a separate module** ;) Tasks are solved in #101 just a good API in PostHTML. ;)

Separate also does not seem like a good plan. > changeable for what? Changeable for changeable? > not about npm-package ok! You gave the example protein-tree ;) is look like...

Concept idea for independent parsers and independent ast in PostHTML Example for parse5 ``` js posthtml([  'parse5-format-ast-plugin1',    'parse5-format-ast-plugin2',    …    'parse5-format-ast-to-posthtml-format-ast', // !!!    'old-plugin',    'plugin-for-xjst' ].map(require)) .process(html, { parser: parse5 })...

base format – PostHTMLTree)

You know about not completeness of PostHTMLTree... in this case need to change format AST in a major release PostHTML

This approach will work with the new tree format, to:) ``` js posthtml([ 'new-format-ast-plugin1', 'new-format-ast-plugin2', … 'new-format-ast-to-old-format-ast', // !!! 'old-plugins' ].map(require)) .process(html, { parser: posthtmlParser2 }) .then(resilt => console.log); ```

@jescalan features are not mutually exclusive

``` js function convertStringNodeToObject(node) { if (typeof node === 'string') return { tag: false, content: node }; return node; }; module.export = function pluginMaybeASTFormat(tree) { tree.walk(convertStringNodeToObject); }; ``` or `posthtml-pug`...