Skip to content

Commit

Permalink
Fix doc highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Apr 3, 2023
1 parent fd64c45 commit 0469343
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/makeup/lexer/postprocess.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@ defmodule Makeup.Lexer.Postprocess do
Actually, you'll want to define some kind of helper to make it less verbose.
For example:
```elixir
defmodule MyTest do
use ExUnit.Case
alias Makeup.Lexers.ElixirLexer
alias Makeup.Lexer.Postprocess
def lex(text) do
text
|> ElixirLexer.lex(group_prefix: "group")
|> Postprocess.token_values_to_binaries()
end
defmodule MyTest do
use ExUnit.Case
alias Makeup.Lexers.ElixirLexer
alias Makeup.Lexer.Postprocess
def lex(text) do
text
|> ElixirLexer.lex(group_prefix: "group")
|> Postprocess.token_values_to_binaries()
end
test "even better with our little helper" do
assert lex(":atom") == [{:string_symbol, %{language: :elixir}, ":atom"}]
end
end
test "even better with our little helper" do
assert lex(":atom") == [{:string_symbol, %{language: :elixir}, ":atom"}]
end
end
"""
def token_values_to_binaries(tokens) do
Enum.map(tokens, &token_value_to_binary/1)
Expand Down

0 comments on commit 0469343

Please sign in to comment.