Allow anchors to wrap anywhere
Purpose
Anchors with very long unbreakable links cause pages to be horizontally scrollable on mobile. Fix this by allowing anchors to break anywhere.
This was observed on the following page: https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html#why-cpio-rather-than-tar
Screenshots
Without the proposed changes:
With the proposed changes:
I've used this before:
overflow-wrap: break-word;
Can anyone tell which one is better in this case?
From https://stackoverflow.com/questions/17259916/difference-between-overflow-wrap-and-word-break, it seems as though word-break is actually deprecated. I'll update my PR to use overflow-wrap.
it seems as though
word-breakis actually deprecated.
I'm not an expert, but AFAIU your SO link (and https://developer.mozilla.org/en-US/docs/Web/CSS/word-break), only word-break: break-word; is deprecated but word-break: break-all; should be fine.
I'm not an expert, but AFAIU your SO link (and https://developer.mozilla.org/en-US/docs/Web/CSS/word-break), only
word-break: break-word;is deprecated butword-break: break-all;should be fine.
I changed it to overflow-wrap, as that seems to be the go-to in other places. I tested it and it works exactly the same.
@AA-Turner Can you take a look at this?