Class: MarkdownIt::RulesCore::Normalize
- Inherits:
-
Object
- Object
- MarkdownIt::RulesCore::Normalize
- Defined in:
- lib/motion-markdown-it/rules_core/normalize.rb
Constant Summary collapse
- NEWLINES_RE =
/\r\n?|\n/
- NULL_RE =
/\0/
Class Method Summary collapse
-
.normalize(state) ⇒ Object
——————————————————————————.
Class Method Details
.normalize(state) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/motion-markdown-it/rules_core/normalize.rb', line 12 def self.normalize(state) # Normalize newlines str = state.src.gsub(NEWLINES_RE, "\n") # Replace NULL characters str = str.gsub(NULL_RE, '\uFFFD') state.src = str end |