ActionText is a power-packed tool to easily build WYSIWYG editors for your Rails applications. It comes with an array of editor options and transformers. One of them is the Plain Text transformer which converts HTML input to plain text output.
As with any editors,
some wonkiness is expected!
to_plain_text on an ActionText content containing nested lists,
the output does not meet expectations.
when using indentations to indicate nested list levels,
converting to plain text does not preserve the indentation.
However, the expected output is close to:
With recent changes in Rails 7 ActionText,
it adds a two-space indentation per nested level for
to_plain_text on action text content!
Which looks like,
To know more about the fix checkout this PR.