PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
254 stars 202 forks source link

Strip newlines from permalink descriptions #2119

Closed jjrsylvestre closed 2 months ago

jjrsylvestre commented 3 months ago

I noticed that the non-rich-text version of permalinks to items whose title contains math have recently started to have extra newlines in the math part for some reason. This patch strips them.

I haven't tested this extensively, but I can't think of any reason why @data-description on a div.autopermalink element might need to contain a newline.

rbeezer commented 2 months ago

Thanks, Jeremy.

for some reason

Well it is the start and end of a span.process-math that each becomes a newline.

I'll merge this, but we do allow multi-line titles (like for a book), so long-term I'd prefer to understand this better.

So pinging @davidfarmer and @ascholerChemeketa since this is mostly Javascript. Title to Chapter 3 of the sample article is a good place to test.

jjrsylvestre commented 2 months ago

for some reason

Well it is the start and end of a span.process-math that each becomes a newline.

Sure, but it seemed like new behaviour, newer than the introduction of process-math.

rbeezer commented 2 months ago

seemed like new behaviour

Yes, I think so.

I do like the looks of #2126. Thanks.