Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there callbacks when processing closed labels? #543

Open
ddx533534 opened this issue Jun 20, 2024 · 3 comments
Open

Are there callbacks when processing closed labels? #543

ddx533534 opened this issue Jun 20, 2024 · 3 comments

Comments

@ddx533534
Copy link

ddx533534 commented Jun 20, 2024

when label closed, I wanna do something, Is there anyway to implement it? For example:

// when encounter </div> I want to add a line break for the text
<div><span>A</span></div>
@max-heller
Copy link

I hoped TreeSink::pop() would allow this, but it doesn't seem to be called when I expect it to.

@max-heller
Copy link

Seems like #149 is asking for the same thing. #149 (comment) suggests pop() may be usable, but that it isn't always called

@ddx533534
Copy link
Author

    /// Indicate that a node was popped off the stack of open elements.
    fn pop(&mut self, _node: &Self::Handle) {}

Yep, I have tried TreeSink::pop(), but it isn't called every time that encountered end tags. Maybe it wasn't designed to do that.

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

No branches or pull requests

2 participants