Uh oh!
There was an error while loading. Please reload this page.
Keep code coloring in search results short text - #68699
Conversation
rust-highfive
commented
Jan 31, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
rust-highfive
commented
Jan 31, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Uh oh!
There was an error while loading. Please reload this page.
kinnison
left a comment
There was a problem hiding this comment.
There's a test case to fix, and a few ideas/points in comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9e7808f to
c95068fCompareGuillaumeGomez
commented
Feb 1, 2020
Updated! |
kinnison
commented
Feb 1, 2020
@bors r+ |
bors
commented
Feb 1, 2020
📌 Commit c95068f5035c6cecb90ba5a555219d751249739c has been approved by |
ollie27
commented
Feb 1, 2020
@bors r- The Additionally if the summaries for the search index are be rendered to HTML then the text will need to be HTML escaped. HTML rendering should use |
GuillaumeGomez
commented
Feb 1, 2020
@ollie27 Great catch! We really need the front-end checks to come back... cc @pietroalbini :) |
GuillaumeGomez
commented
Feb 10, 2020
@ollie27 I fixed the html being added into the titles. However, I don't think we ever use the search index content directly. Do you have a location in mind where it would be the case? Because otherwise, it'll greatly increase the search index size. And I don't really want to put a markdown converter in the front end... |
Uh oh!
There was an error while loading. Please reload this page.
ollie27
commented
Feb 14, 2020
@GuillaumeGomez I don't know what you mean. The search index summaries and the sidebar titles are generated separately. Currently they both use the |
bors
commented
Feb 15, 2020
☔ The latest upstream changes (presumably #69172) made this pull request unmergeable. Please resolve the merge conflicts. |
GuillaumeGomez
commented
Feb 15, 2020
@ollie27 Sorry, I didn't write that in a very understandable way... To make it simple: with the current version, is this issue fixed? |
ollie27
commented
Feb 15, 2020
No, you appear to be trying to treat a symptom rather than the cause. The issue with this PR is that |
GuillaumeGomez
commented
Feb 17, 2020
Ok! |
joelpalmer
commented
Mar 9, 2020
Triaged |
464c3e1 to
d57901dCompareGuillaumeGomez
commented
Apr 25, 2020
I went for the simplest solution (and I think the best too): I only perform this change on the front-end side. Is it good for you too @ollie27 ? |
ollie27
commented
May 3, 2020
This will treat any backticks as though they are surrounding code spans but that's not always the case. |
GuillaumeGomez
commented
May 9, 2020
Do you have an example in mind? That'd make the testing simpler. |
ollie27
commented
May 9, 2020
Some examples I came up with: /// foo `this is a code span` bar \`this isn't\` bazpubstructFoo;/// foo `` this is a code span containing `backticks` `` barpubstructBar; |
GuillaumeGomez
commented
May 10, 2020
So I have to skip if it's "\`" and handle multiple backticks. Makes sense. |
ollie27
commented
May 12, 2020
No. The summaries stored in the search index don't contain that information. For: /// foo `this is a code span` bar \`this isn't\` bazpubstructFoo;the search index contains: There is no way in JavaScript to know which backticks meant codeblocks and which didn't. As I've said, to do this right the summaries need to be rendered and stored in the search index as HTML. |
| } | ||
| function colorCode(s) { | ||
| var parts = s.split("`"); |
There was a problem hiding this comment.
This seems extremely fragile. We should be using the builtin markdown renderer for this
Dylan-DPC-zz
commented
Aug 19, 2020
r? @jyn514 |
jyn514
commented
Aug 19, 2020
I agree with |
GuillaumeGomez
commented
Aug 19, 2020
But then we'll make the search index grows, which I'm trying to avoid. However I agree that doing it on the JS side doesn't look so good. So I really don't know here... |
Manishearth
commented
Aug 19, 2020
I don't think they will grow much here |
GuillaumeGomez
commented
Aug 19, 2020
Another issue is for links: do we want to allow them or not? If they're relative, it's not going to have the expected output, so I guess we'll need to to remove the links there too. |
Manishearth
commented
Aug 19, 2020
Yes, strip links |
jyn514
commented
Sep 11, 2020
Marking this as waiting on author since it doesn't require frontend tests to fix. |
camelid
commented
Sep 15, 2020
So is the plan to go with rendering Markdown to HTML using pulldown? |
GuillaumeGomez
commented
Sep 16, 2020
Yes. |
camelid
commented
Oct 30, 2020
Closing in favor of #77686. |

Fixes#32040.
r? @kinnison