Skip to content
New issue

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

Render Markdown in search results #77686

Merged
merged 6 commits into from
Dec 4, 2020

Commits on Dec 3, 2020

  1. Render Markdown in search results

    Previously Markdown documentation was not rendered to HTML for search results,
    which led to the output not being very readable, particularly for inline code.
    This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark
    (the library rustdoc uses to parse Markdown for the main text of documentation).
    However, the text for the title attribute (the text shown when you hover over an
    element) still uses the plain-text rendering since it is displayed in browsers
    as plain-text.
    
    Only these styles will be rendered; everything else is stripped away:
    
    * *italics*
    * **bold**
    * `inline code`
    camelid committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    5d4a712 View commit details
    Browse the repository at this point in the history
  2. Use createElement and innerHTML instead of DOMParser

    @GuillaumeGomez was concerned about browser compatibility.
    camelid committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    e178030 View commit details
    Browse the repository at this point in the history
  3. Make length_limit a usize

    camelid committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    07e9426 View commit details
    Browse the repository at this point in the history
  4. Add rustdoc-js test

    Finally!
    camelid committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    b903519 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f0cf5a9 View commit details
    Browse the repository at this point in the history
  6. Add missing feature flag

    Accidentally removed in rebase.
    camelid committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    376507f View commit details
    Browse the repository at this point in the history