Unbreak URL preview for formatted links with tooltips (#9022)

* Unbreak URL preview for formatted links with tooltips

Fixes: vector-im/element-web#22764
Signed-off-by: Johannes Marbach <johannesm@element.io>

* Flip back the flag default value 🤦
t3chguy/dedup-icons-17oct
Johannes Marbach 2022-07-08 11:51:37 +02:00 committed by GitHub
parent 4fb11968fa
commit cc64e8eace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -93,9 +93,14 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
// we should be pillify them here by doing the linkifying BEFORE the pillifying.
pillifyLinks([this.contentRef.current], this.props.mxEvent, this.pills);
HtmlUtils.linkifyElement(this.contentRef.current);
tooltipifyLinks([this.contentRef.current], this.pills, this.tooltips);
this.calculateUrlPreview();
// tooltipifyLinks AFTER calculateUrlPreview because the DOM inside the tooltip
// container is empty before the internal component has mounted so calculateUrlPreview
// won't find any anchors
tooltipifyLinks([this.contentRef.current], this.pills, this.tooltips);
if (this.props.mxEvent.getContent().format === "org.matrix.custom.html") {
// Handle expansion and add buttons
const pres = (ReactDOM.findDOMNode(this) as Element).getElementsByTagName("pre");