When using custom style to add ::before pseudo-element on .toc-item element, it causes the <span>${await getHeaderPrefix(header.level)} </span> element to be rendered. Causes the innerText of the .toc-item element to get a space before the string. As a result, the text content of "right click to paste markdown inner link" will have an extra space.
Example
Add the following style to the $profileDir/outline.css file:
Problem
When using custom style to add
::before
pseudo-element on.toc-item
element, it causes the<span>${await getHeaderPrefix(header.level)} </span>
element to be rendered. Causes theinnerText
of the.toc-item
element to get a space before the string. As a result, the text content of "right click to paste markdown inner link" will have an extra space.Example
Add the following style to the
$profileDir/outline.css
file:The results below:
The reault of copying "Header A" is
[test# Header A](:/2fda63fe0401450fa2a4ab093a35da99#header-a)
.Solution
Use
trim()
method removes whitespace from both ends of a string.