We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the editor customHTMLRenderer works as expected and gives this result for me:
<p>before <a href="mm4i-search:interesting" style="color:red">find</a> after</p>
But in the viewer I instead get this very strange result:
<p data-nodeid="7">before <a href="mm4i-search:interesting" style="color:red" data-nodeid="11"></a>find<a href="mm4i-search:interesting" style="color:red" data-nodeid="11"></a> after</p>
The HTML code is copied directly from Developer tools in Google Chrome today (which I just updated).
const mm4iRenderer = { link(node, context) { console.log({ node }); const { origin } = context; const url = node.destination; const isAlfa = url.startsWith("mm4i-search:"); console.warn("mm4iRenderer link", url, isAlfa); if (isAlfa) { const linkAttrs = { href: url }; linkAttrs.style = "color:red"; console.log("after red", linkAttrs); return [ { type: 'openTag', tagName: 'a', attributes: linkAttrs }, { type: 'closeTag', tagName: 'a' } ]; } return origin(); } }
See above.
The text was updated successfully, but these errors were encountered:
For the moment I will use a workaround:
It looks like it is about 50 lines of code.
Sorry, something went wrong.
While implementing this I just saw something that might be relevant for the bug. Searching the ww mode element there are three :
2: <a href="mm4i-search:interesting" style="color:red" data-nodeid="5"></a> 1: <a href="mm4i-search:interesting" style="color:red">find</a>
Two of them are those empty <a>:s I mentioned before.
<a>
This suggests to me there is a bug either in Prose-mirror or in Chromes handling of "contenteditable".
I decided not to use customHTMLRenderer. In my case I can get the same result with some CSS.
No branches or pull requests
Describe the bug
In the editor customHTMLRenderer works as expected and gives this result for me:
But in the viewer I instead get this very strange result:
The HTML code is copied directly from Developer tools in Google Chrome today (which I just updated).
To Reproduce
Expected behavior
See above.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: