Skip to content

Commit 857569a

Browse files
committed
Add note to html entity handler
1 parent 147743e commit 857569a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/fulfil/concerns/html_entity_handler.rb

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
module Fulfil
44
module Concerns
5+
# Handles HTML entity escaping in JSON serialization
6+
# This module provides methods to temporarily disable and re-enable HTML entity escaping
7+
# when working with ActiveSupport's JSON encoding, which is particularly useful when
8+
# dealing with special characters in API requests.
9+
#
10+
# @example
11+
# class MyParser
12+
# include Concerns::HtmlEntityHandler
13+
#
14+
# def parse_data
15+
# with_disabled_html_entities do
16+
# # Your code here that needs HTML entities disabled
17+
# end
18+
# end
19+
# end
520
module HtmlEntityHandler
621
private
722

0 commit comments

Comments
 (0)