• Resolved Abid

    (@hussain76)


    When submitting our feed to the W3C Feed Validator a warning is being reported:

    line 94, column 0: Invalid HTML: Named entity expected. Got none. (3 occurrences)

    The line’s content is

    <content:encoded><![CDATA[<div></div><figure><img src="https://apollo-news.net/wp-content/uploads/2024/01/imago0309909843h.jpg" class="type:primaryImage" /></figure>

    I do not see where in this line there’s missing a named entity.

    Is this is a GN Publisher issue or is it something we should solve by ourself? Which character the warning message refers to?

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

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

    (@gnpublisher)

    Hi, thank you for reaching out to us. We have checked on our end and found the error. The style tag is causing the issue as its placement in the code violates the rules and guidelines of the HTML environment, which is why you are facing this error. Kindly review and adjust the placement of the style tag. Once you make the necessary changes, it should resolve the issue.

    Thread Starter Abid

    (@hussain76)

    Thanks. What makes me wonder is that in the current version of the feed the only error message is:

    Invalid HTML: Named entity expected. Got none.

    There is no mention about a style tag anymore (it had been mentioned before).

    Are you sure it’s the style tag which is causing the error? If yes, please let me know how to modify the feed’s content (is it done by a wordpress hook?).

    Plugin Author GNPublisher

    (@gnpublisher)

    Hi, we confirm that the error is being caused by the style tag. Regarding the second error, “Invalid HTML: Named entity expected. Got none,” it is due to the presence of the ” <ins ” tag within the ” <!– Twiago Display Ad Tag —>“. You can verify this in the attached screenshot: https://paste.pics/QBFW3, Check this link also: https://validator.w3.org/feed/check.cgi#l28 You will know the error also. Removing the “<ins> ” tag should resolve the issue. Please implement the suggested changes and recheck. If you still encounter any concerns, feel free to inform us.

    • This reply was modified 9 months, 3 weeks ago by GNPublisher.
    Thread Starter Abid

    (@hussain76)

    Thank you! You write:

    Removing the “<ins>?” tag should resolve the issue.?

    This tag displays an ad banner and is therefore necessary for the “non-feed” version of the page.

    So I need to remove this in the CDATA parts of the feed.

    Could you give any hint to me how to modify the contents of the feed generated by GN Publisher? Can it be done using a WordPress hook?

    Plugin Author GNPublisher

    (@gnpublisher)

    Hi, apologies for the delayed response as we are addressing this issue. Please copy the code below and apply it.

    add_filter(‘the_content_feed’, ‘gnpub_callback’);”add_filter(‘the_content_feed’, ‘gnpub_callback’);

    function gnpub_callback($content){
    $content = preg_replace(“//i”,”, $content);
    return $content;
    }

    Once you’ve done so, let us know if it works.

    Thread Starter Abid

    (@hussain76)

    Sorry, but the code you provided is syntactically wrong and makes no sense ??

    Only thing I got from the code is to make use of ‘the_content_feed’ hook. So I was able to solve the issue:

    function gnpub_callback($content) {
      $content = preg_replace("/<ins.+?<\/ins>/", "", $content);
      $content = preg_replace("/<style.+?<\/style>/", "", $content);
      return $content;
    }
    add_filter('the_content_feed', 'gnpub_callback', 1, 1);
    • This reply was modified 9 months, 2 weeks ago by Abid.
    • This reply was modified 9 months, 2 weeks ago by Abid.
    Plugin Author GNPublisher

    (@gnpublisher)

    Hi, sounds great that you got the solution. Actually, we sent the same code, but it accidentally misprinted. Anyways, glad to hear that your issue has been resolved. We’re closing this thread, but if you need any help, please let us know. Have a great day ahead!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Feed Validator reports Invalid HTML: Named entity expected. Got none.’ is closed to new replies.