I have tried the BBCode-Anchors-Example from Erel. So far so good. That's exactly what I need. But I have a problem. My chapters do not consist of static text, but come from a localisation table.
This causes a problem with the text engine and I have not yet found a way to solve this problem. Perhaps one of you has an idea.
So far I have stored the text in a webview as an HTML file with integrated links within the document. This worked perfectly, but has the disadvantage that images cannot be integrated so easily. The text itself is available in 15 different languages... So up to now there were 15 different HTML documents, which were then loaded according to the language. A huge administrative effort when making changes...
With BBCode, this effort would be significantly reduced.
The problem with using BBCode is as follows:
When inserting variable strings in BBCode, as I understand it, an end marker must be set, followed by an ‘&’, then the string from the localisation table, then another ‘&’, followed by the marker for activating the text engine.
Funnily enough, there is no error message when coding, but when executing the code, the text engine gets confused. In my opinion, the reason for this is the two consecutive quotation marks in line 7.
What am I doing wrong or how can I solve the problem? Does anyone have any ideas? Maybe it's just too late again and I should just take a break. But somehow I'm deep in the woods at the moment...
Cheers BV
This causes a problem with the text engine and I have not yet found a way to solve this problem. Perhaps one of you has an idea.
So far I have stored the text in a webview as an HTML file with integrated links within the document. This worked perfectly, but has the disadvantage that images cannot be integrated so easily. The text itself is available in 15 different languages... So up to now there were 15 different HTML documents, which were then loaded according to the language. A huge administrative effort when making changes...
With BBCode, this effort would be significantly reduced.
Working code with static text based on Erel's example:
Dim s As String = $"
[a=top]Chapters:[/a]
[url]Chapter 1[/url]
[url]Chapter 2[/url]
[url]Chapter 3[/url]
[a="Chapter 1"][b]Chapter 1[/b][/a] dolor sit amet, consectetur adipiscing elit.
[url=top]Top [FontAwesome=0xF062/][/url]
[a="Chapter 2"][b]Chapter 2[/b][/a] imperdiet pharetra scelerisque. Suspendisse potenti.
[url=top]Top [FontAwesome=0xF062/][/url]
[a="Chapter 3"][b]Chapter 3[/b][/a] pretium commodo mauris quis egestas.
[url=top]Top [FontAwesome=0xF062/][/url]
"$
BBCodeHelp.Text = s
Failing code with variable text:
Dim s As String = $"
[a=top]Chapters:[/a]
[url]"$&LOC.Localize("Chapter 1")&$"[/url]
[url]Chapter 2[/url]
[url]Chapter 3[/url]
[a=""$&LOC.Localize("Chapter 1")&$"][b]Chapter 1[/b][/a] dolor sit amet, consectetur adipiscing elit.
[url=top]Top [FontAwesome=0xF062/][/url]
[a="Chapter 2"][b]Chapter 2[/b][/a] imperdiet pharetra scelerisque. Suspendisse potenti.
[url=top]Top [FontAwesome=0xF062/][/url]
[a="Chapter 3"][b]Chapter 3[/b][/a] pretium commodo mauris quis egestas.
[url=top]Top [FontAwesome=0xF062/][/url]
"$
BBCodeHelp.Text = s
Funnily enough, there is no error message when coding, but when executing the code, the text engine gets confused. In my opinion, the reason for this is the two consecutive quotation marks in line 7.
What am I doing wrong or how can I solve the problem? Does anyone have any ideas? Maybe it's just too late again and I should just take a break. But somehow I'm deep in the woods at the moment...
Cheers BV