Fix frozen literal warning; add tests.
Showing the changes to lib/docs (1 of 16 files). Show all
Unified · Split
| @@ -6,9 +6,12 @@ module Docs · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | def call | 7 | def call |
| 8 | return html if context[:clean_text] == false | 8 | return html if context[:clean_text] == false |
| 9 | html.strip! | 9 | |
| 10 | while html.gsub!(EMPTY_NODES_RGX, ''); end | 10 | # Clone frozen literal. |
| 11 | html | 11 | result = html.dup |
| 12 | result.strip! | ||
| 13 | while result.gsub!(EMPTY_NODES_RGX, ''); end | ||
| 14 | result | ||
| 12 | end | 15 | end |
| 13 | end | 16 | end |
| 14 | end | 17 | end |