Skip to content

Commit

Permalink
added spacing after Math blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
EricMarcon committed Mar 11, 2024
1 parent 9cd12b6 commit 2998a7f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fr-nbsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
--- Copyright: © 2022 Christopher Fuhrman
--- License: MIT – see LICENSE for details

--- Updated by Eric Marcon
--- line 61: added or inlines[i].t == 'Math'

PANDOC_VERSION:must_be_at_least '2.9.2'

local THIN_SPACE_PATTERN_ASCII = '[;!%?]'
Expand Down Expand Up @@ -56,7 +59,7 @@ local function space_high_punctuation_and_quotes(inlines)
--

if inlines[i + 1] and inlines[i + 1].t == 'Str' and not string.find(inlines[i + 1].text, THIN_NBSP) -- didn't already insert THIN_NBSP
and (inlines[i].t == 'Quoted' or inlines[i].t == 'Cite' or inlines[i].t == 'Link' or inlines[i].t == 'Emph' or inlines[i].t == 'Strong' or inlines[i].t == 'Strikeout' or inlines[i].t == 'Code' or inlines[i].t == 'RawInline')
and (inlines[i].t == 'Quoted' or inlines[i].t == 'Cite' or inlines[i].t == 'Link' or inlines[i].t == 'Emph' or inlines[i].t == 'Strong' or inlines[i].t == 'Strikeout' or inlines[i].t == 'Code' or inlines[i].t == 'RawInline' or inlines[i].t == 'Math')
and string.match(inlines[i + 1].text:sub( -1), ALL_SPACE_PATTERN_ASCII) then
if (string.len(inlines[i + 1].text) == 1) then
-- print(i, 'fixing (3):', inlines[i+1])
Expand Down

0 comments on commit 2998a7f

Please sign in to comment.