git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: Add a comment explaining strNormalize

`normalize` from Text.Pandoc.Shared is more general. In tests, though, it more than doubles the run time. `strNormalize` does less, but it does what we need. This comment is added for future maintainability.

commit2aa5f58c5b82dd5750e1bf5f30e1936d132104ac authorJesse Rosenthal <jrosenthal@jhu.edu> dateFri 20 Jun 2014, 10:27 (12 years ago) parent03af19a
1 file changed+4
src/Text/Pandoc/Readers/Docx.hs+4
src/Text/Pandoc/Readers/Docx.hs+4
@@ -144,6 +144,10 @@ runElemToString (Tab) = ['\t']
144144runElemsToString :: [RunElem] -> String
145145runElemsToString = concatMap runElemToString
146146
147+--- We use this instead of the more general
148+--- Text.Pandoc.Shared.normalize for reasons of efficiency. For
149+--- whatever reason, `normalize` makes a run take almost twice as
150+--- long. (It does more, but this does what we need)
147151strNormalize :: [Inline] -> [Inline]
148152strNormalize [] = []
149153strNormalize (Str "" : ils) = strNormalize ils