I want to replace certain characters with their respective HTML entities in an HTML response inside a filter. Characters include <
, >
, &
. I can't use replaceAll()
as it will replace all characters, even those that are part of HTML tags.
What is the best approach for doing so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…