mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05:00
Markdown/Textile escape system is more flexible and strips goofy parsing glitches much better. Fixes #500
This commit is contained in:
parent
adc4e1f2ef
commit
ca470417e5
@ -4,12 +4,12 @@
|
||||
module TemplateWrapper
|
||||
# Wrap input with a <div>
|
||||
def safe_wrap(input)
|
||||
"<div class='bogus-wrapper'><notextile>#{input}</notextile></div>"
|
||||
"<!--escape--><div class='escape-wrapper'><notextile><!--content-->#{input}<!--end-content--></notextile></div><!--end-escape-->"
|
||||
end
|
||||
# This must be applied after the
|
||||
def unwrap(input)
|
||||
input.gsub /<div class='bogus-wrapper'><notextile>(.+?)<\/notextile><\/div>/m do
|
||||
$1
|
||||
input.gsub /<!--escape-->([\s\S]*?)<!--content-->(.+?)<!--end-content-->([\s\S]*?)<!--end-escape-->/m do
|
||||
$2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user