Module: AsciiChem::Transform::TextNormaliser

Defined in:
lib/asciichem/transform.rb

Overview

Strips the surrounding "..." quotes from a quoted text match. Used by both text_run and group_text_run rules so the model never carries the delimiters — the formatter re-adds them on output.

Class Method Summary collapse

Class Method Details

.strip_quotes(s) ⇒ Object



156
157
158
# File 'lib/asciichem/transform.rb', line 156

def self.strip_quotes(s)
  s.start_with?('"') && s.end_with?('"') ? s[1..-2] : s
end