Open tlylt opened 2 years ago
I think it's because the tree
component uses markdown-it to render its contents using the renderInline
method (here and here). However, pop-up components need to go through processNode
in order to parse their contents, so rendering it as inline markdown is insufficient for fully parsing the node.
This means that any component that requires processNode
, e.g. include
, won't work either:
<div id="fragment">this is a fragment</div>
<tree>
C:/course/
<include src="./index.md#fragment" />
</tree>
Maybe we can add in the docs that the tree component only supports inline markdown?
In the docs we already have this line
You can use Tree in combination with inline Markdown or inline HTML elements.
and also
Currently, Pop-Ups(tooltip/trigger) are not supported within a tree component.
as an alert. I think this is sufficient (though I wouldn't be opposed to further refining the wording)
I think at present, it is not necessary to explore also supporting this as it looks troublesome without much benefit? Would welcome more opinions.
Keeping it as a low priority item seems reasonable to me.
What did you do? Please include the actual source code causing the issue. The support for inline markdown/HTML elements works for most syntax within the tree component, but not for tooltip/popover
Testing the above code will give:
Notice the white space added in front of the words "index.md" and "via trigger". While the direct tooltip approach does not work on hover, the trigger approach works. Not too sure if this is a bug with the tooltip/trigger element or is it due to the newly added tree component.
More context in the description and comments of #1807
What did you expect to happen? Expect the tree component to support inline components such as tooltip.
What actually happened? Please include the actual, raw output. Either not working as expected, or with unwanted spaces added in front of the trigger words