markdown how to anchor link special characters like ä ö ü - visual-studio-code

description
I want to link some titles in Markdown. It works good except when I link a German word like "Systemüberwachung" or "ähnliches". I think this is not working because of the "ü" and "ä".
I already tried to link like this: #system-berwachung, #systemberwachung, #systemuberwachung and many others.
But how can I link word with the characters ä ö and ü?
I use VSCode 1.63.2 and Markdown Preview
test code snippet
- [Systemüberwachung](#systemüberwachung)
- [something](#something)
- [ähnliches](#ähnliches)
## Systemüberwachung
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet
## something
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet
## ähnliches
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet
.

It looks like Visual Studio Code takes the title string, lower-cases it, and URL-encodes it. That makes sense, as these are essentially URL fragments.
Heading
Link fragment
Systemüberwachung
system%C3%BCberwachung
ähnliches
%C3%A4hnliches
You can reproduce this in JavaScript, e.g. like so:
encodeURIComponent("Systemüberwachung".toLowerCase())
//=> "system%C3%BCberwachung"
(There's probably more to this logic, e.g. to replace punctuation, but for the purposes of this question I think this is the relevant part.)
Unfortunately, these links don't seem to actually work, even though they are linking to the correct elements. I'm not sure why that is.
Background
Since Visual Studio Code is built on Webview, I discovered this by opening up its dev tools with the "Developer: Open Webview Developer Tools" command via the command palette.
Then I used the "select an element" feature (also available via Ctrl+Shift+C when the dev tools are open and focused):
Clicking on the rendered title brings up the underlying HTML in the devtools panel:
Which then reveals the generated ID:
<h1 data-line="0" class="code-line" id="system%C3%BCberwachung">Systemüberwachung</h1>
We can verify that we are using the correct ID in the devtools console, e.g.
document.getElementById("system%C3%BCberwachung")

# German umlaut characters
## Table of Content
- [Systemüberwachung](#systemuberwachung)
- [something](#something)
- [ähnliches](#ahnliches)
<div id="systemuberwachung">
<h2>Systemüberwachung</h2>
</div>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ...
## something
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ...
<div id="ahnliches">
<h2>ähnliches<h2>
</div>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ...
.

Related

Replace string inside curvy brackets

I would need to replace the strings contained within the curved brackets with the same strings but with an initial prefix and curly brackets \fill{(test_string)}. Is this possible?
Example:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore.
(first_string)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore.
(second_string)
Transform in:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore.
\fill{(first_string)}
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore.
\fill{(second_string)}
As suggested, you could use a regex search and replace. A simple example of this can be found here. In your case, this should work:
The regular expression \(([^\)]+)\) does the following (as taken from this site - you'll need to paste the regex into the site to see the explanation):
\( matches the character literally (case sensitive)
1st Capturing Group ([^\)]+)
Match a single character not present in the list below [^\)]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\) matches the character ) literally (case sensitive)
\) matches the character ) literally (case sensitive)
In Visual Studio Code, if you enable regex search by clicking the .* icon in the search bar, you can put this regular expression in. Then, in the replace section, you can put \fill{($1)} where the $1 is the 1st Capturing Group mentioned previously (the first_string, second_string, etc. part found by the regular expression).
There are a lot of Regex posts here on Stackoverflow you may want to read. One notable one is Greedy versus Lazy.

How to resize Popover window?

I have created a Popover that looks as follows:
How to set the Popover window smaller?
if you just wanna show an information to the user use an sap.m.MessageBox.
sap.m.MessageBox.information(
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat"
);
If you need sap.m.Popover go for sth. like this:
contentWidth="{= ${device>/system/phone} ? '100%' : '20%'}"
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<Popover title="Popover" placement="Bottom" contentWidth="{= ${device>/system/phone} ? '100%' : '20%'}" class="sapUiContentPadding">
<Text
text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."/>
</Popover>
</core:FragmentDefinition>

How to vertical align material ui Checkbox

Simple put, I'd like to vertical align the Checkbox from Material UI.
Try changing alignItems style property of FormControlLabel.
This worked for me:
<FormControlLabel
sx={{ alignItems: 'flex-start' }}
control={
<Checkbox
sx={{
marginTop: -1,
}}
/>
}
/>
This took me a while to track down, but this solution for another forum was the one that worked:
<FormControl fullWidth>
<FormControlLabel
style={{display:'table'}}
control={<div style={{display:'table-cell'}}><CustomizedCheckbox/></div>}
label={<div className="disclaimerandnotes">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>}
/>
</FormControl>
Since MUI is based on Flexbox, you can simply override its alignItems property:
<FormControlLabel
control={
<div style={{ alignSelf: 'start' }}>
<Checkbox checked={isChecked()} onChange={check.toggle} />
</div>
}
label="Toggle Checkbox"
/>
You can probably make it even leaner by overriding the checkbox component style.

Replacement for deprecated SAP UI5 Control "TextView"

What is the recommended replacement for the SAP UI5 Control "TextView", which is deprecated since 1.38?
I found this outdated Control while working through the SAPUI5 Walkthrough tutorial and following a "related information" link that is still using on the old TextView Control.
There is no replacement info given in the API Reference of TextView:
https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.commons.TextView
You can use sap.m.Text instead. Api.
View example:
<mvc:View
xmlns:l="sap.ui.layout"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<VBox class="sapUiSmallMargin">
<Text text="Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat" />
</VBox>
</mvc:View>

Analyzing and storing text in a data structure

I hope you understand what I want to do. It is hard to choose the best words, because English is not my first language and I distrust automatic translators. I will try to explain as well as I can.
I was thinking about analyzing a long text. Suppose, for example, that I have a string divided into paragraphs.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mattis consectetur purus sit amet fermentum.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit tempus porttitor. Maecenas sed diam eget risus varius blandit sit amet non magna.
I would like to store this string in an array or something similar, in a way I can find the length or location of the two paragraphs very quickly. For example (pseudocode):
Array => {
paragraphs => {
"Lorem ipsum dolor sit amet, [...] fermentum.",
...
}
}
I don't really know whether this has a name. I suppose there is much theory about how to do this type of task. I am really interested in practices that take care about performance when processing a big amount of text. I would like to have something to study and read carefully.
Any help would be very appreciated. Thanks in advance,
—Alberto
Perhaps read into Apache's UIMA, it's all about analyzing unstructured information, text analysis being a major component of it.