Hiding Search Page Descriptions?

imaria
imaria

Because of the way the search descriptions just hack the top off a page, including HTML tags, it's making the search page often unreadable if the wrong page gets pulled into the results. I tried to just hide the descriptions, BUT it turns out the description portion of results is in a <p> tag, which auto-closes when it reaches a bunch of other tags.



Has anyone come up with any clever workarounds for this? I wish the descriptions were div tags; then this would have been a two second fix.

Comments

  • Abersade
    Abersade
    Posts: 629

    Do you have an example page or screenshot that I can look at?

    GM of Stream of Kairos - 2025 Campaign of the Year

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • imaria
    imaria
    Posts: 6 edited September 2025

    Here are a few screenshots that should show the issue:


    This one shows what I'm trying to avoid: the search pulls out the terms from the middle of articles with html formatting, producing unreadable gibberish for the descriptions.




    So THIS is one example of what it looks like when I set the <p> tags within the search results to not display:

    Note that part of the broken description is still showing for the Dragons article. For reference, this is what that portion of the article ACTUALLY looks like:

    And here is another example of the broken descriptions "breaking out" of the hidden <p> tags:





    The relevant CSS code used is:

    .campaign-search-page .search-result p { display: none; }



    Hiding just the "description" class did even less, but this isn't enough either. The problem is that the <p> tag that's meant to ENCLOSE the whole description is instead automatically closed by browsers as soon as the search description contains a <p> tag. It breaks everything past that point out of CSS control.

    Post edited by imaria on
  • C4RB0N
    C4RB0N
    Posts: 61

    @imaria 

    Hi friend! I'll pass this question along to the devs, in the meantime the screenshot would be helpful if you could provide one!

  • imaria
    imaria
    Posts: 6

    @C4RB0N

    The screenshots are up! The thing that would need changing is that the "description" class field shouldn't be a <p> tag; it should be a <div> tag. The description class might need some adjustment to make it behave like a p tag, but it honestly might not.

    The separate, larger issue is that the search results don't strip out HTML, but I suspect that would be a much larger fix.

  • vadercomplex
    vadercomplex
    Posts: 267

    Gotcha, okay - relaying this back to the team, thank you! @imaria 

    Obsidian Portal Support Druid | [email protected]

  • vadercomplex
    vadercomplex
    Posts: 267

     

    @imaria We heard back from the Devs:

    Thanks! I’ve changed the “p” tag to be a “div” tag for the “description”, so the member should be able to effectively hide that now.

     Okay - let us know if it worked! 

    Obsidian Portal Support Druid | [email protected]

  • imaria
    imaria
    Posts: 6

    It's beautiful. Many thanks for the quick fix, @vadercomplex !

  • vadercomplex
    vadercomplex
    Posts: 267

    You got it! :) @imaria

    Obsidian Portal Support Druid | [email protected]

  • C4RB0N
    C4RB0N
    Posts: 61

    Hi @imaria ! Our devs took a second look at this and we'd like to see if you could check the results again and see if they are better now or not?

  • imaria
    imaria
    Posts: 6 edited September 2025

    @C4RB0N

    Oh, wow. They are vastly better now! As in, I can now disable the helpful description hiding CSS that was just enabled (though I can still use the div tag to correctly format the descriptions, so that's still useful).

    Many, many thanks!

    Post edited by imaria on
Sign In or Register to comment.

September 2026
City of Shadows

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions