Skip to content

Question: Markup and Script/Style? #607

Description

@panoply

Playing around with this idea. Users of Liquid (for example) use this language in combination with JavaScript, while not something anyone recommends it's common practice. Trying to beautify Liquid and JavaScript would render the parser to fail (logically) however, if you were to exclude the Markup tags before passing the syntax to PrettyDiff this can be achieved.

See this working Flems example which simply replaces the Liquid markup tags with a string value and comments out the Liquid tags based on a simple expression. This approach fools PrettyDiff into thinking the syntax it's receiving is JavaScript and thus formatting can be applied.

Just curious, is there a more logical way to exclude Markup tags from certain lexers? Has this been explored or is there a different way one could go about this?

Edit:

Regarding the Flems example, press the "Example Code" checkbox and use the tabs to see the different states of parsing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions