TYPO3-Documentation / render-guides

Render the docs with phpdocumentor/guides
GNU General Public License v3.0
3 stars 8 forks source link

[BUGFIX] Fix word wrapping for long confval titles #718

Closed mouflondarko closed 3 months ago

mouflondarko commented 3 months ago

Fixes #698 This rather simple fix makes confval titles break preferably by white space, if there is no white space present or word is too long it will break anywhere.

BEFORE: obraz

AFTER: obraz

Note: Non-alphanumeric signs like dots or dashes are not taken into account when wrapping - in order to break titles by them, it would be necessary to parse the title beforehand to insert the Line Break Opportunity <wbr> tag when needed (e.g. before a dot or a dash), like so:

this.text.breaks.anywhere
this<wbr>.text<wbr>.breaks<wbr>.on<wbr>.dots

Here is the preview for titles using the <wbr> tags (inserted manually):

email<wbr>.templateRootPaths
expose<wbr>Nonexistent<wbr>User<wbr>In<wbr>Forgot<wbr>Password<wbr>Dialog

obraz

linawolf commented 3 months ago

While you are at it, could you make sure that the other texts like the default value in the screenshot are also breaking?

garvinhicking commented 3 months ago

@linawolf could we use this and insert it automatically for siteset directives and others too, basically after any "." character?

Copying such words should not copy hidden chars then since it's only invisible html markup....?

Sounds great to me :)

linawolf commented 3 months ago

@garvinhicking we could make a twig function for that I guess

mouflondarko commented 3 months ago

@linawolf sure, I've pushed a commit that resolves the issue (<wbr> tags would also work for those values): obraz

linawolf commented 3 months ago

Thanks for this change, merged, I will collect several changes before I make a new release however.

Could you open an Issue about the wbr tags?