Age old & to & conversion issue
-
I am trying to use browser in-built PDF viewing capabilities via an HTML <object/> block, using the text (non-visual) editor as follows:
<!-- wp:html --> <object data="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf?#zoom=85&scrollbar=0&toolbar=1&navpanes=1" type="application/pdf" width="100%"> <embed src="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf" type="application/pdf"/> <p>This browser does not support PDFs. Please download the PDF to view it: <a href="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf">Download PDF</a>.</p> </object> <!-- /wp:html -->1stThe problem is at render time, those &’s are converted to &’s.
Here is what I see in the HTLML source upon viewing the page:<object data="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf?#zoom=85&scrollbar=0&toolbar=1&navpanes=1" type="application/pdf" width="100%"> <embed src="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf" type="application/pdf"> <p>This browser does not support PDFs. Please download the PDF to view it: <a href="https://cadieuxbicycleclub.com/wp-content/uploads/2022/07/2022_Hines_TT.pdf">Download PDF</a>.</p> </object>So, as you can see, my exact HTML was not preserved, despite being in a wp:html block.
I checked the DB contents for the page and it did get stored correctly, which confirms the conversion to & is happening at render time.
NOTE: I was also having age-old problems with Gutenberg doing the conversion and storing it incorrectly, so to fix that I installed the Classic Editor plugin so I could get the page stored correctly. But even so I am still facing the issue at render time.
- This topic was modified 3 years, 8 months ago by . Reason: Moved to Fixing WordPress from Everything else WordPress
- This topic was modified 3 years, 8 months ago by .
The page I need help with: [log in to see the link]
The topic ‘Age old & to & conversion issue’ is closed to new replies.