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

href ids replaced without corresponding name ids corrections #8632

Closed
olegStreejak opened this issue Jul 27, 2022 · 9 comments
Closed

href ids replaced without corresponding name ids corrections #8632

olegStreejak opened this issue Jul 27, 2022 · 9 comments

Comments

@olegStreejak
Copy link

hello
I have found the following error: one of my centos stream 9 box daily sends logwatch report, which I configured as html. At start there's menu in html to ease the navigation within the report, e.g.:

<!-- End header.html -->
<a name=top><ul>
<li><a href="#1">LOGWATCH Summary</a>
<li><a href="#2">Kernel Audit</a>
<li><a href="#3">Cron</a>
<li><a href="#4">dnf-rpm</a>
...

It is original letter text (mail source). In the browseк it transfers to:

<ul><a name="top">
</a><li><a name="top"></a><a href="#v11">LOGWATCH Summary</a>
</li><li><a href="#v12">Kernel Audit</a>
</li><li><a href="#v13">Cron</a>
</li><li><a href="#v14">dnf-rpm</a>

with hrefs like https://hostname/?_task=mail&_caps=pdf%3D1%2Cflash%3D0%2Ctiff%3D0%2Cwebp%3D1%2Cpgpmime%3D0&_uid=some_num0&_mbox=INBOX.xxx&_framed=1&_action=preview#v11

but there's no navigation as the anchers names isn't changed, it's, for example:

<h2><a name="1">LOGWATCH Summary</a></h2>

in both cases.

I'm trying to find the code that replaces href and names (seems to me that it's somewhere at program/js/app.js) but still have no idea how to correct this.

Please correct it either at href's url replacemnt or at name's. Thank you in advance

@olegStreejak
Copy link
Author

aah, I forgot! Sorry
I'm using Roundcube Webmail 1.7-git [GIT 20220724.1345] from git

@olegStreejak
Copy link
Author

I simplified the case w/ the same results: in editor add source html

<p><a href="#1">test link</a></p>
<hr style="margin-top: 172%;" />
<h2><a name="1"></a>test anchor</h2>

save it in draft folder and in preview test link href is https://host/?_task=mail&_caps=pdf%3D1%2Cflash%3D0%2Ctiff%3D0%2Cwebp%3D1%2Cpgpmime%3D0&_uid=3259&_mbox=INBOX.Drafts&_framed=1&_action=preview#v11

source in Chromium DevTool

<div class="rcmBody" style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif">
<p><a href="#v11">test link</a></p>
<hr style="margin-top: 172%">
<h2><a name="1"></a>test anchor</h2>
</div>

@alecpl
Copy link
Member

alecpl commented Jul 29, 2022

We need to add $this->_css_prefix to the name attribute on <a> elements. Somewhere in rcube_washtml::wash_attribs().

@olegStreejak
Copy link
Author

the proposed patch
program-lib-Roundcube-rcube_washtml.php-patch.txt

alecpl added a commit that referenced this issue Jul 30, 2022
alecpl added a commit that referenced this issue Jul 30, 2022
@alecpl
Copy link
Member

alecpl commented Jul 30, 2022

Fixed.

@alecpl alecpl closed this as completed Jul 30, 2022
@olegStreejak
Copy link
Author

hello. I noticed such a related rergression: when the link is activated, the buttons top margin is decreased and then it can not be scrolled/restored back to its original state - only reload the page in browser (e.g. Ctrl+R). See the screen-grabbed video:

clear_margin_top.mov

If i use interface links (like details or any interface button) it works as expected and the margins (visually) stay constant. I've git pulled and update jsdeps + composer stuff - but the effect is repeatable and exists.

Source of the e-mail is quite simple and alike the one mentioned above:

<p><a href="#v11" name="v1top">top / to one</a></p>
<p style="margin-top: 777px;"><a href="#v1top" name="v11">one / to top</a></p>

(yes, it adds v1 at the beginning every time a source code is edited, but i'm not bother as long as it adds everywhere and the code works as expected)

@olegStreejak
Copy link
Author

olegStreejak commented Aug 24, 2022

up
@alecpl please have a look at my previous comment here, there's a slight regression
up: regression is under chromium ver 104.0.5112.101 (official build), for Linux Mint (64 bits); under Firefox 104.0 (64 bits) everything is ok

@alecpl
Copy link
Member

alecpl commented Jun 21, 2023

Sorry, I missed that. Anyway, how is that a regression? This is a different issue and should have a separate ticket.

@olegStreejak
Copy link
Author

Never mind, as they say - better late than never =)
Well, now it's just the same - when click on <a href=#id>, it scrolls the page several pixels up, and they can be restored by page refresh (e.g. by pressing Ctrl+R ) only. The regression lives under Chromium (version 114.0.5735.133 (official build, for Linux Mint (64 bits)
BTW it doesn't happen in chromium and when in separate window - just tested
FireFox 114.0.2 (64-bits; Linux Mint build) is also regression-free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants