aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Entities.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Entities.hs')
-rw-r--r--src/Text/Pandoc/Entities.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Entities.hs b/src/Text/Pandoc/Entities.hs
index e91cf3864..703d4d230 100644
--- a/src/Text/Pandoc/Entities.hs
+++ b/src/Text/Pandoc/Entities.hs
@@ -31,9 +31,9 @@ and vice versa.
module Text.Pandoc.Entities (
charToEntity,
charToNumericalEntity,
- encodeEntities,
decodeEntities,
escapeSGMLChar,
+ escapeSGMLString,
characterEntity
) where
import Data.Char ( chr, ord )
@@ -100,12 +100,12 @@ needsEscaping :: Char -> Bool
needsEscaping c = c `elem` "&<>\""
-- | Escape string as needed for SGML. Entity references are not preserved.
-encodeEntities :: String -> String
-encodeEntities "" = ""
-encodeEntities str =
+escapeSGMLString :: String -> String
+escapeSGMLString "" = ""
+escapeSGMLString str =
case break needsEscaping str of
(okay, "") -> okay
- (okay, (c:cs)) -> okay ++ escapeSGMLChar c ++ encodeEntities cs
+ (okay, (c:cs)) -> okay ++ escapeSGMLChar c ++ escapeSGMLString cs
-- | Convert entities in a string to characters.
decodeEntities :: String -> String