Skip to content

Commit d3fef09

Browse files
authored
Merge pull request #290 from ashmaroli/process-node-text
Apply mention filter & emoji filter on node text
2 parents cdb9436 + 7630ab0 commit d3fef09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/html/pipeline/@mention_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def call
7171
result[:mentioned_usernames] ||= []
7272

7373
doc.search('.//text()').each do |node|
74-
content = node.to_html
74+
content = node.text
7575
next if !content.include?('@')
7676
next if has_ancestor?(node, IGNORE_PARENTS)
7777
html = mention_link_filter(content, base_url, info_url, username_pattern)

lib/html/pipeline/emoji_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class EmojiFilter < Filter
1616

1717
def call
1818
doc.search('.//text()').each do |node|
19-
content = node.to_html
19+
content = node.text
2020
next unless content.include?(':')
2121
next if has_ancestor?(node, ignored_ancestor_tags)
2222
html = emoji_image_filter(content)

0 commit comments

Comments
 (0)