Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/html2confluence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ def normalise_space(s)

# Escape any special characters.
def escape_special_characters(s)
return s
# Escaping is disabled now since it caused more problems that not having
# it. The insertion of unecessary escaping was annoying for JIRA users.
s.to_s.gsub(/[*#+\-_{}|]/) do |s|
s.to_s.gsub(/[*#+\-_{}|!]/) do |s|
"\\#{s}"
end
end
Expand Down Expand Up @@ -125,7 +124,7 @@ def handle_data(data)
write(data)
else
data ||= ""
data = normalise_space(escape_special_characters(data))
data = normalise_space(data)
if @last_write[-1] =~ /\s/
data = data.lstrip # Collapse whitespace if the previous character was whitespace.
end
Expand Down Expand Up @@ -427,6 +426,7 @@ def tag_end(name)
end

def text(string)
string = escape_special_characters(string) unless @preserveWhitespace
handle_data(string)
end
end