|
220f1dfa
|
2015-09-22T08:25:13
|
|
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 "##".
|