Sha256: 859e4849210f313201c847b061c4f583165112164a78ff69381e49bc7b974e17
Contents?: true
Size: 1.34 KB
Versions: 12
Compression:
Stored size: 1.34 KB
Contents
# -*- coding: utf-8 -*- module LaTeX module Decode class Punctuation < Decoder @macros = Hash[*%w{ textendash – textemdash — textquoteleft ‘ textquoteright ’ quotesinglbase ‚ textquotedblleft “ textquotedblright ” quotedblbase „ dag † ddag ‡ textbullet • dots … textperthousand ‰ textpertenthousand ‱ guilsinglleft ‹ guilsinglright › textreferencemark ※ textinterrobang ‽ textoverline ‾ langle ⟨ rangle ⟩ textasciicircum ^ textbackslash \\ textasciitilde ~ textquotesingle ' }].freeze @symbols = Hash[*%w[ - - -- – --- — `` “ ` ‘ '' ” ' ’ ]].freeze @map = @macros.merge(@symbols).freeze @patterns = [ /\\(#{ @macros.keys.map { |k| Regexp.escape(k) }.compact.join('|') })(?:\{\}|\s+|\b|$)/ou, /(-+|`{1,2}|'{1,2})/, /()\\([$%;#_&])(\{\})?/, /()\\(~)\{\}/, /()\\( )/ ].freeze end end end
Version data entries
12 entries across 12 versions & 3 rubygems