• korg007

    (@gillesgagnon)


    Hi Mikko, Thanks for offering this great plugin. We’re trying to use it on our site in development (link privately shared).
    The site uses Elementor Pro and the issue we’re experiencing is that pages use the Elemenntor DIvider widget with an custom SVG icon. It appears part of that svg code is included in the search results.
    For example “.st0{fill:#424143;}” appears in search results where the widget is used.

    How can we prevent this from occurring and display only the actual text of pages?

    We look forward to hearing form you,
    Cheers!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mikko Saari

    (@msaari)

    It’s because the SVG icon looks like this:

    <svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 12 10.5">	.st0{fill:#424143;}<g> ... </g></svg></div>

    When Relevanssi strips the tags, the SVG tag is removed, but the contents of the tag remain – that’s the standard way to handle HTML tags, and Relevanssi doesn’t know that the <svg> tag is special and the contents of the tag should also be removed.

    This is something I will fix in the next version of Relevanssi. The <svg> tags will then be completely removed. Meanwhile, you can use this snippet on your site to fix the problem:

    add_filter( 'relevanssi_excerpt_content', function( $content ) {
    return preg_replace( '#<svg.*?</svg>#', '', $content );
    } );

    This will remove all <svg> tags from the post content before Relevanssi generates the excerpts.

    Thread Starter korg007

    (@gillesgagnon)

    Thanks a million, Mikko!
    I’ll implement the shortcode while we wait for the permanent fix.

    On that same page, why is it that the Search Bar function, at the top right, becomes non-responsive and can not be used following an initial search? That is, after search results are displayed, the user can not perform another search as the Search field appears disabled.

    We look forward to your response.

    Plugin Author Mikko Saari

    (@msaari)

    I can’t reproduce that error. I can make repeated searches without problems.

    Thread Starter korg007

    (@gillesgagnon)

    Thanks for checking Mikko. You’re correct. I tried a diff browser and all is well. Maybe it’s one of my chrome extensions. My apologies.

    Thread Starter korg007

    (@gillesgagnon)

    Hi Mikko, I wanted to report back.
    It wasn’t an extension. It turns out the issue of not being able to access the Search field arises if I’m logged in as Admin, and have performed a successful search (search results displayed). Under those conditions, for some reason Elementor (?) adds this CSS rul which breaks the Search:

    .elementor-widget-search .hidden {
        opacity: 0;
        visibility: hidden;
    }

    ** The problem only exists if I turn on Relevanssi’s “Create custom search result snippets”. Which in my case, I need.

    I had to add robust css to override it, using the .logged-in class.
    Any thoughts?

    Plugin Author Mikko Saari

    (@msaari)

    This is normal weirdness from Elementor. If you can fix it, you can ignore it.

    Thread Starter korg007

    (@gillesgagnon)

    hahaha! yes, Elem weirdness does rear its head at times.
    I hope this bit will prevent others from pulling their hair out.
    Keep up the good work Mikko.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.