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

Fix Elixir format lookalike strings which may be present in docs #105

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading