mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
This commit is contained in:
parent
4e1f25197d
commit
30990006a9
2201 changed files with 4482 additions and 90 deletions
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PlainTextToMarkdown
|
||||
SIGNATURE_SEPARATOR ||= "-- ".freeze
|
||||
|
||||
|
@ -15,7 +17,7 @@ class PlainTextToMarkdown
|
|||
prepare_lines
|
||||
classify_lines
|
||||
|
||||
markdown = ""
|
||||
markdown = +""
|
||||
last_quote_level = 0
|
||||
last_line_blank = false
|
||||
|
||||
|
@ -172,7 +174,7 @@ class PlainTextToMarkdown
|
|||
end
|
||||
|
||||
def escape_special_characters(text)
|
||||
escaped_text = ""
|
||||
escaped_text = +""
|
||||
|
||||
text.split(URL_REGEX).each do |text_part|
|
||||
if text_part =~ URL_REGEX
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue