Skip to content

[IDEA] Serailize/toString of AST node #8255

Description

@linonetwo

Is your feature request related to a problem? Please describe.

Need to get original wikitext from AST, when writing WYSIWYG editor.

Describe the solution you'd like

Add rule = exports.name field to ast node, and add exports.toString to wikiparsers.

In toString, try call handleChildrenToString. (The problem is where to find this method, we can't access $tw in the wikiparser. Can we put it on parser passed from exports.init = function(parser) {?

Describe alternatives you've considered

Now it is maintained in https://github.com/tiddly-gittly/wikiast, but is quickly outdated.

Additional context

I remember some other issue we talk about adding a rule field to the ast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions