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.
This commit is contained in:
parent
03af19a7e1
commit
2aa5f58c5b
1 changed files with 4 additions and 0 deletions
|
@ -144,6 +144,10 @@ runElemToString (Tab) = ['\t']
|
|||
runElemsToString :: [RunElem] -> String
|
||||
runElemsToString = concatMap runElemToString
|
||||
|
||||
--- We use this instead of the more general
|
||||
--- Text.Pandoc.Shared.normalize for reasons of efficiency. For
|
||||
--- whatever reason, `normalize` makes a run take almost twice as
|
||||
--- long. (It does more, but this does what we need)
|
||||
strNormalize :: [Inline] -> [Inline]
|
||||
strNormalize [] = []
|
||||
strNormalize (Str "" : ils) = strNormalize ils
|
||||
|
|
Loading…
Add table
Reference in a new issue