On 09/03/2023 19:43, Ihor Radchenko wrote:
Max Nikulin writes:
Both "Heading" and "[0/1]" have the same :post-blank " ", so when
stripping the statistics cookie use " " :post-blank for "Heading"
(retain current value).
Sorry, but we are mis-communicating here.
No, it just means that I am not familiar enough with org-element structures.
:post-blank can be either nil or a number of spaces/tabs after object.
Plain strings always have :post-blank nil.
So do line breaks.
If preceding object is string than trailing spaces should be taken into
account instead of :post-blank. If footnote reference or similar object
has more :post-blank spaces than replace it by string with space
characters to have footnote's :post-blank in total. Alternatively append
these spaces to the preceding string.
----
Text with newline \\
[fn:1] more text.
----
#("Text with newline " 0 18
(:parent #2))
(line-break
(:begin 19 :end 22 :post-blank 0 :parent #2))
#(" " 0 1
1 space--^
(footnote-reference
(:label "1" ... :post-blank 2 :parent #2))
2 spaces---------------------------^
#("more text.\n" 0 11
So stripping the footnote use 2 spaces " " instead of preceding " " or
add another " " (unsure if 2 adjacent strings may be a problem for
export backends).
I was imprecise, but I do not see any contradictions.