auto_hyphenating_text icon indicating copy to clipboard operation
auto_hyphenating_text copied to clipboard

Bold formatting using \\b markers not supported or hard to implement with AutoHyphenatingText

Open Sunisha-Eversion opened this issue 7 months ago • 4 comments

I’m trying to apply bold formatting to specific words within a block of text using custom markers (e.g., \bword\b) when rendering text with AutoHyphenatingText. However, there doesn’t seem to be a straightforward way to parse and style inline text segments dynamically, as AutoHyphenatingText doesn’t support TextSpan or rich text formatting out of the box.

Example input string:

"Im Modell siehst du, dass die \b blau dargestellten Muskeln \b verlängert und die \b gelb dargestellten Muskeln \b verkürzt sind. Durch die Ergebnisse können wir Rückschlüsse auf deine angegebenen Schmerzen ziehen. In den folgenden Schritten erklären wir dir die Auswirkungen."

Expected behavior:

Words wrapped in \b...\b should be rendered in bold, preserving the hyphenation and layout behavior of AutoHyphenatingText.

What I tried:

Parsing the string and using RichText with TextSpan works, but AutoHyphenatingText does not support this.

Feature Request or Question:

Could AutoHyphenatingText support some kind of inline styling or custom parsing logic for rich text features like bold/italic? Or is there a recommended approach to achieve this?

Thanks in advance.

Sunisha-Eversion avatar Jun 16 '25 07:06 Sunisha-Eversion

Why not use markdown?

impure avatar Jun 21 '25 02:06 impure

Why not use markdown?

Hi, but you're referring to a plugin, right? I was actually looking for hyphenation as well. So, is there something we can do with AutoHyphenatingText?

Sunisha-Eversion avatar Jun 23 '25 08:06 Sunisha-Eversion

I mean instead of \b and \b why not use ** and **

impure avatar Jun 24 '25 20:06 impure

**

Not working. Not a solution with this plugin.

Sunisha-Eversion avatar Jun 30 '25 12:06 Sunisha-Eversion