Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight Elixir string markdown header correctly #775

Merged
merged 1 commit into from
Sep 22, 2015

Commits on Sep 22, 2015

  1. Highlight Elixir string markdown header correctly

    Elixir allows markdown inside its triple-quote heredoc syntax. However,
    the "#" used in markdown headers is currently misinterpreted as a
    comment. So, if you write this:
    
    ```elixir
    @doc """
    Get the first name of a user.
    
    - `user` - A User struct.
    
        user = %User{name: "Alice Winston"}
        User.first_name(user)
        "Alice"
    
    """
    ```
    
    Prism interprets the markdown headers as comments, not as part of the
    string, and this messes up the coloring.
    
    This can be fixed by adding a negative lookbehind, such that the
    comments regex matches "#" but not "##".
    danielberkompas committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    220f1df View commit details
    Browse the repository at this point in the history