aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Entities.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-06 09:54:58 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-06 09:54:58 +0000
commitbb8478e4e24b431ca81ee7f669d517eb11a47500 (patch)
tree3dedfbceaf88404e531b81e37f07b8f026f07ebb /src/Text/Pandoc/Entities.hs
parent06e6107f535ae921f4b1fec2e7de7dd98b793435 (diff)
downloadpandoc-bb8478e4e24b431ca81ee7f669d517eb11a47500.tar.gz
Merged changes from 'quotes' branch since r431. Smart typography
is now handled in the Markdown and LaTeX readers, rather than in the writers. The HTML writer has been rewritten to use the prettyprinting library. git-svn-id: https://pandoc.googlecode.com/svn/trunk@436 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Entities.hs')
-rw-r--r--src/Text/Pandoc/Entities.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Entities.hs b/src/Text/Pandoc/Entities.hs
index fd3cf9e57..26785b9a8 100644
--- a/src/Text/Pandoc/Entities.hs
+++ b/src/Text/Pandoc/Entities.hs
@@ -32,14 +32,19 @@ module Text.Pandoc.Entities (
entityToChar,
charToEntity,
decodeEntities,
- encodeEntities
+ encodeEntities,
+ characterEntity
) where
import Data.Char ( chr, ord )
-import Text.Regex ( mkRegex, matchRegexAll )
+import Text.Regex ( mkRegex, matchRegexAll, Regex )
import Maybe ( fromMaybe )
--- regexs for entities
+-- | Regular expression for decimal coded entity.
+decimalCodedEntity :: Text.Regex.Regex
decimalCodedEntity = mkRegex "&#([0-9]+);"
+
+-- | Regular expression for character entity.
+characterEntity :: Text.Regex.Regex
characterEntity = mkRegex "&#[0-9]+;|&[A-Za-z0-9]+;"
-- | Return a string with all entity references decoded to unicode characters