Skip to content

Commit

Permalink
Merge pull request #105 from aws-beam/fix-elixir-lookalike-format-str…
Browse files Browse the repository at this point in the history
…ings-in-docs

Fix Elixir format lookalike strings which may be present in docs
  • Loading branch information
onno-vos-dev committed Mar 9, 2024
2 parents eeec832 + 12cbb11 commit 6ba75a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/gen_elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ jobs:
run: |
mkdir -p $ELIXIR_OUTPUT_PATH
mix run generate.exs elixir $SPEC_PATH $TEMPLATE_PATH $ELIXIR_OUTPUT_PATH
- name: Test aws-elixir
run: |
mix deps.get
mix test
working-directory: aws-beam/aws-elixir
5 changes: 5 additions & 0 deletions lib/aws_codegen/docstring.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defmodule AWS.CodeGen.Docstring do
|> Enum.map(&justify_line(&1, @max_elixir_line_length))
|> Enum.join("\n")
|> fix_broken_markdown_links()
|> fix_elixir_lookalike_format_strings()
|> fix_html_spaces()
|> fix_long_break_lines()
|> transform_subtitles()
Expand Down Expand Up @@ -58,6 +59,10 @@ defmodule AWS.CodeGen.Docstring do
String.replace(text, ~r/\[([^\n]+)\n\s\s([^]]+)\]/, "[\\1 \\2]")
end

defp fix_elixir_lookalike_format_strings(text) do
String.replace(text, ~r/#\{(.*?)\}/, "\\1")
end

# We added these spaces for each list level.
defp fix_html_spaces(text) do
String.replace(text, " ", " ")
Expand Down

0 comments on commit 6ba75a2

Please sign in to comment.