Module: JekyllMiscellaneous::Hooks::Mark
- Defined in:
- lib/jekyll_miscellaneous/hooks/mark.rb
Class Method Summary collapse
-
.process(doc) ⇒ Object
Searches and replaces within a document’s content for the expression ==input==, and replaces it with the HTML tag <mark>input</mark>.
Class Method Details
.process(doc) ⇒ Object
Searches and replaces within a document’s content for the expression ==input==, and replaces it with the HTML tag <mark>input</mark>.
Parameters:
- doc
-
The document to search and replace within.
Returns:
The document with the expression replaced.
Example:
=='Hello, World!'==
<mark>Hello, World!</mark>
19 20 21 |
# File 'lib/jekyll_miscellaneous/hooks/mark.rb', line 19 def self.process(doc) doc.content.gsub!(/==+(\w(.*?)?[^ .=]?)==+/, '<mark>\\1</mark>') end |