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

removing empty text nodes #152

Open
pkra opened this issue Mar 15, 2016 · 0 comments
Open

removing empty text nodes #152

pkra opened this issue Mar 15, 2016 · 0 comments

Comments

@pkra
Copy link
Contributor

pkra commented Mar 15, 2016

Some valid JATS constructs can cause Lens to add empty text nodes (and maybe other types of nodes as well?).

For example,

<p><disp-formula>...</disp-formula></p>`

can lead to something like

<div class="content-node paragraph" data-id="paragraph_1">
    <div class="content">
        <div class="content-node text" data-id="text_1">
            <div class="content">
            </div>
            <div class="focus-handle"></div>
        </div>
    </div>
    <div class="focus-handle"></div>
</div>
<div class="content-node formula" data-id="formula_1">
    <div class="focus-handle"></div>
    <div class="content">
    ...
    </div>
</div>

which produces a sizable gap in the document due to the empty .paragraph subtree.

It would be great if Lens could check if a node has content before injecting it. It seems like a well-placed check for length 0 should be enough, but I have trouble finding the right spot for it.

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

1 participant