diff --git a/lib/aws_codegen/docstring.ex b/lib/aws_codegen/docstring.ex index 0ed8bd7..76cf0ba 100644 --- a/lib/aws_codegen/docstring.ex +++ b/lib/aws_codegen/docstring.ex @@ -34,6 +34,7 @@ defmodule AWS.CodeGen.Docstring do |> Enum.map(&justify_line(&1, @max_erlang_line_length, "%% ")) |> Enum.join("\n") |> fix_long_break_lines() + |> escape_ellipsis_followed_by_dot() |> String.trim_trailing() |> String.replace(@two_break_lines, "\n%%\n") |> String.replace(~r/'/, "'") @@ -62,6 +63,13 @@ defmodule AWS.CodeGen.Docstring do String.replace(text, " ", " ") end + # aws-sdk-go docs may use .... to act as a "wildcard" which breaks edocs with the following error: + # warning: found "..." followed by ".", please use parens around "..." instead + # so let's do exactly what edoc is suggesting + defp escape_ellipsis_followed_by_dot(text) do + String.replace(text, "....", "(...).") + end + defp fix_long_break_lines(text) do String.replace(text, ~r/[\n]{3,}/, @two_break_lines) end