• Resolved raydh188

    (@raydh188)


    Hi,

    Im having issues to integrat WordPress rest api becouse of bad json output. Whenever i try to format and validate my json it gives me this error :

    Error: Parse error on line 778:
    …t”: { “rendered”: “<p>Nj\u00eb nd\u00e
    ———————-^
    Expecting ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{‘, ‘[‘, got ‘undefined’

    This is my json : https://pastebin.com/29YUrtMK

    Any help or idea what might be causing this ? ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • @raydh188

    Something has gone wrong with the escaping of the content of post 78622, the content has been split into 2 parts due to incorrect escaping of the alt parameter of an image inserted into the content – there is an escaping character before the alt parameter and the quotes are not appropriately escaped.

    You may want to check that the image tag in that post is correctly formed in the first place.

    Thread Starter raydh188

    (@raydh188)

    Hi @mattyrob , thanks for your response.

    This is not the only json on my website that has errors in image alt tags. Any idea what might be causing this? Maybe becouse the alt of images are empty ?
    I can’t find any fix online

    @raydh188

    It is likely coming from malformed content somewhere but as your theme contains errors itself it’s hard to see where it’s coming from – you have 2 lots of <head> tags for a start.

    Have a look at fixing some of those errors:

    https://validator.w3.org/nu/?doc=https%3A%2F%2Fexit.al%2Fpa-testime-te-mjaftushme-qeverite-e-shqiperise-dhe-kosoves-po-deshtojne-ne-luften-kunder-koronavirusit%2F

    Thread Starter raydh188

    (@raydh188)

    hi mattyrob, i found and fixed the issue. Now the json response is valid. it was the function that minify html and cleanup empty spaces.

    –> It is likely coming from malformed content somewhere
    your response made my search the functions that i had in theme and many things it took me many hours but finally i found it ??

    Thank you so much for your help

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress Rest Api Issue With Images’ is closed to new replies.