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 | 7 | def call |
| 8 | 8 | return html if context[:clean_text] == false |
| 9 | − html.strip! | |
| 10 | − while html.gsub!(EMPTY_NODES_RGX, ''); end | |
| 11 | − html | |
| 9 | + | |
| 10 | + # Clone frozen literal. | |
| 11 | + result = html.dup | |
| 12 | + result.strip! | |
| 13 | + while result.gsub!(EMPTY_NODES_RGX, ''); end | |
| 14 | + result | |
| 12 | 15 | end |
| 13 | 16 | end |
| 14 | 17 | end |