Skip to content

Implement smartquotes for HTML export#6592

Closed
MDLC01 wants to merge 3 commits intotypst:mainfrom
MDLC01:html-smartquotes
Closed

Implement smartquotes for HTML export#6592
MDLC01 wants to merge 3 commits intotypst:mainfrom
MDLC01:html-smartquotes

Conversation

@MDLC01
Copy link
Collaborator

@MDLC01 MDLC01 commented Jul 12, 2025

Fixes #6337.

I'm not sure if iterating over the previous nodes is the best way to get the last character. This is similar to the way it's done for paged export though:

let before =
collector.full.chars().rev().find(|&c| !is_default_ignorable(c));

@MDLC01 MDLC01 changed the title mplement smartquotes for HTML export Implement smartquotes for HTML export Jul 12, 2025
@laurmaedje
Copy link
Member

Thanks for tackling this! This is a good start, but it doesn't fully mirror the behavior of the layout implementation because the smart quoter state is local to a single HTML element's body. This means, for example, the example below does not work correctly:

"Hello *World"*
<p>“Hello <strong>World“</strong></p>

To fully mirror the layout implementation (which is paragraph local), we'd want to somehow keep the state in inline contexts, but reset it for block-level elements. It's a little tricky because it would need to span over multiple different realizations. Might take some experimentation to figure out how to transport that state. I had started thinking about this a bit recently, but didn't yet get to the experimentation stage.

@laurmaedje laurmaedje added the waiting-on-author Pull request waits on author label Jul 28, 2025
@MDLC01
Copy link
Collaborator Author

MDLC01 commented Aug 5, 2025

Sorry for holding the lock for so long. I don't think I will have the time to think of a clean way to do that anymore.

@laurmaedje
Copy link
Member

Revived in #6710

@MDLC01 MDLC01 deleted the html-smartquotes branch August 24, 2025 10:05
@laurmaedje laurmaedje removed the waiting-on-author Pull request waits on author label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HTML export] Straight quotes aren’t automatically being converted to curly quotes

2 participants