Skip to content

Add the raw match to the shortcode object. #9

@danieliser

Description

@danieliser

On line 58 I changed it to

            this.matches.push({
                name: key,
                tag: tag,
                regex: regex,
                options: options,
                contents: contents,
                raw: match[0]
            });

For background on this change, I am using it to help with automated Shortcode replacement in my plugin line. Similar to Shortcake (Shortcode UI) which may eventually get included in core, I am doing live replacement in the editor.

Basically with your utility I can pass in an array of tags & a single callback purely for detection.

I need the raw(including content in place) to both send via ajax for rendering and to restore on editor save.

PS My UI/UX as far as form / setting management is much simpler & more organized than the current versions of Shortcake :) hence the reason for doing it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions