diff options
author | defanor <defanor@uberspace.net> | 2017-11-17 05:45:41 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-17 05:45:41 +0300 |
commit | 36b2e0b5f49861ebe04aa410130fc4a12ed2b3eb (patch) | |
tree | 04d2bc155bfb3f343cb29fc6b5e21e8c2270146e /Pancake | |
parent | 7390b37f0a907d764e0b183ca307f37c20bb068b (diff) |
Narrow footnotes
The "note N" strings add to the overall width, so the width of notes
themselves should be reduced.
It's different in CLI and Emacs, and rather imprecise here, so can
still be improved -- but at least overflow is unlikely now.
Diffstat (limited to 'Pancake')
-rw-r--r-- | Pancake/Rendering.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs index 24afcfc..2c1823a 100644 --- a/Pancake/Rendering.hs +++ b/Pancake/Rendering.hs @@ -336,7 +336,9 @@ readInline (P.Image attr alt (url, title)) = do readInline (P.Note bs) = do -- Minor issues are quite likely with this. st <- get - let ro = runRenderer (columns st) (linkCount st) (noteCount st) 0 + -- 12 is somewhat arbitrary, but narrowing the rendered notes so + -- that "^{note xxx}" could be added without overflow. + let ro = runRenderer (columns st - 12) (linkCount st) (noteCount st) 0 (renderBlocks bs) cnt <- storeNote ro pure [Superscript . Fg Red . fromString $ "[" ++ show cnt ++ "]"] |