-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line Break Tags Added to Scripts and Styles #9056
Comments
Would you be able to provide a reference copy of the content of your post? I understand you might not be able to provide an exact copy because of the contents of your ad script, but something close we could test conversion from Classic Editor post to Gutenberg post would be great–it would help us diagnose what is being converted incorrectly. |
Here is what the script looks like with Gutenberg active following an edit
to the Post:
<p><script type="text/javascript"><br />
amzn_assoc_placement = "adunit0";<br />
amzn_assoc_search_bar = "true";<br />
amzn_assoc_tracking_id = "sonickingbipod-20";<br />
amzn_assoc_search_bar_position = "bottom";<br />
amzn_assoc_ad_mode = "search";<br />
amzn_assoc_ad_type = "smart";<br />
amzn_assoc_marketplace = "amazon";<br />
amzn_assoc_region = "US";<br />
amzn_assoc_title = "Shop Related Products";<br />
amzn_assoc_default_search_phrase = "rifle bipod";<br />
amzn_assoc_default_category = "All";<br />
amzn_assoc_linkid = "a1b2fc8a8ce074ceaa7079988bc7";<br />
</script><br /><script src="//
z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script></p>
I altered the tracking ID and linkid above. Let me know if the html does
not come through in this email.
Gary
|
It does come through, but if you could paste an unedited-by-Gutenberg, before being edited by Gutenberg version of the content so we can try to convert it ourselves that'd be great. If you paste the content via GitHub we can style the HTML a bit better, but email works too 😄 Thanks! |
This is from the very end of the Post.
*Before*:
Overall, this is a good, solid, basic bipod, which is what the majority of
users want. The price is in the midrange compared to other similar models.
<a href="
https://www.amazon.com/Sonicking-Adjustable-Hunting-Rifle-Tactical/dp/B073CSWM13/ref=as_li_ss_tl?ie=UTF8&qid=1530889174&sr=8-1&keywords=sonicking+bipod&dpID=41uuYMJLGDL&preST=_SY300_QL70_&dpSrc=srch&linkCode=ll1&tag=mmpsonickingbipod-20&linkId=1096c69eeb4a48c9442497e89ea466d9"
rel="nofollow">Check the pricing and availability of the Sonicking
Adjustable Rifle Bipod on Amazon today.</a>
[helpful]
<script type="text/javascript">
amzn_assoc_placement = "adunit0";
amzn_assoc_search_bar = "true";
amzn_assoc_tracking_id = "sonickingbipod-20";
amzn_assoc_search_bar_position = "bottom";
amzn_assoc_ad_mode = "search";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_title = "Shop Related Products";
amzn_assoc_default_search_phrase = "rifle bipod";
amzn_assoc_default_category = "All";
amzn_assoc_linkid = "a1b2fc8a8ce074ceaa7079988bc7";
</script>
<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US
"></script>
*After*:
Overall, this is a good, solid, basic bipod, which is what the majority of
users want. The price is in the midrange compared to other similar models.
<a href="
https://www.amazon.com/Sonicking-Adjustable-Hunting-Rifle-Tactical/dp/B073CSWM13/ref=as_li_ss_tl?ie=UTF8&qid=1530889174&sr=8-1&keywords=sonicking+bipod&dpID=41uuYMJLGDL&preST=_SY300_QL70_&dpSrc=srch&linkCode=ll1&tag=mmpsonickingbipod-20&linkId=1096c69eeb4a48c9442497e89ea466d9"
rel="nofollow">Check the pricing and availability of the Sonicking
Adjustable Rifle Bipod on Amazon today.</a>
[helpful]
<p><script type="text/javascript"><br />
amzn_assoc_placement = "adunit0";<br />
amzn_assoc_search_bar = "true";<br />
amzn_assoc_tracking_id = "sonickingbipod-20";<br />
amzn_assoc_search_bar_position = "bottom";<br />
amzn_assoc_ad_mode = "search";<br />
amzn_assoc_ad_type = "smart";<br />
amzn_assoc_marketplace = "amazon";<br />
amzn_assoc_region = "US";<br />
amzn_assoc_title = "Shop Related Products";<br />
amzn_assoc_default_search_phrase = "rifle bipod";<br />
amzn_assoc_default_category = "All";<br />
amzn_assoc_linkid = "a1b2fc8a8ce074ceaa7079988bc7";<br />
</script><br /><script src="//
z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script></p>
Let me know if you need more.
Gary
…On Thu, Aug 16, 2018 at 4:05 PM Matthew Riley MacPherson < ***@***.***> wrote:
It does come through, but if you could paste an unedited-by-Gutenberg,
before being edited by Gutenberg version of the content so we can try to
convert it ourselves that'd be great.
If you paste the content via GitHub we can style the HTML a bit better,
but email works too 😄
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeXeDJYYEWsMPa38u7hcn8ncBjN7lks5uRd6egaJpZM4WARet>
.
|
Any news on this issue? I'm having same problem. :( |
No news as of yet: if there are any updates we will post them in the issue 😊 You can subscribe to any issue you’d like updates to on GitHub in the future, but rest assured when we know more we’ll post here😊 |
This has happened to me as well, and I'm guessing that it also happened to every other Amazon associate that uses ad code within their posts. Even if you open an old post to edit it, it converts everything right away, adds br tags and breaks the ads. |
I thought for sure this would have been fixed before 5.0 came out, but it
hasn't. Not even by 5.0.2.
Come on, guys, this is a big one. Can we get it done in 5.0.3 or 5.1?
Gary
…On Fri, Jan 4, 2019 at 3:47 AM shuttermuse ***@***.***> wrote:
This has happened to me as well, and I'm guessing that it also happened to
every other Amazon associate that uses ad code within their posts. The
problem is that it doesn't just do it to new posts, it has done it to every
old post as well.
It has broken every Amazon ad on every post and page!! What's worse is
that people probably don't even realize it has done this and every day it
will be costing them earnings. I think this is a pretty major issue, and on
my own site I don't even know what to do about it. I have hundreds of pages
with ads that are broken, but I can't fix them because it just keeps adding
the br tags back again.
Switching back to Classic Editor doesn't undo the br tags that it has
added, so there's no way back that I can see. Apart from downgrading bak to
wp4.something and then painstakingly going through hundreds and hundreds of
posts to delete the br tags.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeejCKMEWZ9_HCuZIV_9Xd81zpABOks5u_yMggaJpZM4WARet>
.
|
After examining my several sites, I'm now confused. On some of them, the
Amazon Native Shopping Ads show up just fine, even with the line breaks
within the script. On others, the ads do not show until I remove the
script. So far, I can't see a difference between these instances.
Gary
On Fri, Jan 4, 2019 at 9:56 AM Gary Sonnenberg <gsonnenberg@gmail.com>
wrote:
… I thought for sure this would have been fixed before 5.0 came out, but it
hasn't. Not even by 5.0.2.
Come on, guys, this is a big one. Can we get it done in 5.0.3 or 5.1?
Gary
On Fri, Jan 4, 2019 at 3:47 AM shuttermuse ***@***.***>
wrote:
> This has happened to me as well, and I'm guessing that it also happened
> to every other Amazon associate that uses ad code within their posts. The
> problem is that it doesn't just do it to new posts, it has done it to every
> old post as well.
>
> It has broken every Amazon ad on every post and page!! What's worse is
> that people probably don't even realize it has done this and every day it
> will be costing them earnings. I think this is a pretty major issue, and on
> my own site I don't even know what to do about it. I have hundreds of pages
> with ads that are broken, but I can't fix them because it just keeps adding
> the br tags back again.
>
> Switching back to Classic Editor doesn't undo the br tags that it has
> added, so there's no way back that I can see. Apart from downgrading bak to
> wp4.something and then painstakingly going through hundreds and hundreds of
> posts to delete the br tags.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#9056 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AoeyeejCKMEWZ9_HCuZIV_9Xd81zpABOks5u_yMggaJpZM4WARet>
> .
>
|
Strange. Can you share the url of a page where it is working? I have 4 sites and it broke the ads on all of them. |
Sure. This Post still has the line break tags within the Amazon script:
https://opticsoasis.com/sonicking-adjustable-rifle-bipod-a-solid-newcomer/
The ads are at the end of the post.
Gary
…On Fri, Jan 4, 2019 at 1:39 PM shuttermuse ***@***.***> wrote:
Strange. Can you share the url of a page where it is working?
I have 4 sites and it broke the ads on all of them.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeZG_jEt9WfHvsXj7DDoKT0ZReSZAks5u_64EgaJpZM4WARet>
.
|
Sorry, I don't think I replied to all the first time.
This Post still has the line break tags within the Amazon script:
https://opticsoasis.com/sonicking-adjustable-rifle-bipod-a-solid-newcomer/
The ads are at the end of the post.
Gary
…On Fri, Jan 4, 2019 at 1:39 PM shuttermuse ***@***.***> wrote:
Strange. Can you share the url of a page where it is working?
I have 4 sites and it broke the ads on all of them.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeZG_jEt9WfHvsXj7DDoKT0ZReSZAks5u_64EgaJpZM4WARet>
.
|
No, the ads don't display for me. Perhaps you had some browser caching going on. Definitely not working as far as I can see. |
Ok, thanks. Or maybe my being logged in.
Gary
…On Fri, Jan 4, 2019 at 1:45 PM shuttermuse ***@***.***> wrote:
No, the ads don't display for me. Perhaps you had some browser caching
going on. Definitely not working as far as I can see.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeZNC-KeMYcIIEEv-Lr8Zi6VwW2bgks5u_69lgaJpZM4WARet>
.
|
Ok, I know I'm usually contrary, but this is weird. Since posting my problem, WP/GTB has updated to 5.02. When I saw your posts, I went to check one of my 7 sites. I have some posts that I haven't converted to Gutenberg blocks; everything is in one giant Classic block. (Am updating as I go). Within that giant Classic block, the code appears correctly. The Amazon ads are showing properly on the post UNTIL I update that post without converting it to Gutenberg blocks. Now I have the https://home-sweet-decor.com/a-babysitter-notebook-is-super-handy-and-gives-you-peace-of-mind/ In my 'Gutenberg block posts' (those created after the update), I have the Amazon code in a Custom HTML block. The code appears correctly both in the editor and on the published post. That's this page: https://home-sweet-decor.com/soccer-wall-clocks/ When converting some posts to Gutenberg, I found that the code would get messed up with Hope the extra detail helps a little. :) I did clear my browser cache. Best, |
I haven't converted any Classic Blocks. My ads are not showing because of
the line break tags in those blocks.
My theme is usually Twenty Sixteen, in case that matters.
Gary
…On Fri, Jan 4, 2019 at 2:58 PM SylviaMayfield ***@***.***> wrote:
Ok, I know I'm usually contrary, but this is weird. Since posting my
problem, WP/GTB has updated to 5.02. When I saw your posts, I went to check
one of my 7 sites.
I have some posts that I haven't converted to Gutenberg blocks; everything
is in one giant Classic block. (Am updating as I go). Within that giant
Classic block, the code appears correctly. The Amazon ads are showing
properly on the post UNTIL I update that post without converting it to
Gutenberg blocks. Now I have the
tags too and the ads aren't showing. Gone. That's this page:
https://home-sweet-decor.com/a-babysitter-notebook-is-super-handy-and-gives-you-peace-of-mind/
In my 'Gutenberg block posts' (those created after the update), I have the
Amazon code in a Custom HTML block. The code appears correctly both in the
editor and on the published post. That's this page:
https://home-sweet-decor.com/soccer-wall-clocks/
When converting some posts to Gutenberg, I found that the code would get
messed up with
tags if I just copied it over to it's new Custom HTML block. The code HAD
to be freshly generated. That one has me stumped. It was working in the
post BEFORE updating, but copying it from it's old Classic block to a new
Custom HTML block of it's own, breaks it. Now there's a headscratcher. :)
Hope the extra detail helps a little. :) I did clear my browser cache.
Best,
Sylvia
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeSvFh7Y__rGCRQtdgvTX-h6QHAWlks5u_8BZgaJpZM4WARet>
.
|
@glsonn Did you open those posts and update anything in them or maybe just exit the post? Seems like it's happening right in there someplace. On mine the tags got added after I updated the post in any way. Even if I didn't update anything in that post, I have to click the Update button. You get the "Are you sure you want to leave" box if you don't. So even though I may just have opened them to look (like the babysitter post) - I had to click the Update button to exit the editor and then I had the tags and the ads poofed. hth |
I see a post on my site that isn't showing the ads. I click Edit, then Edit
as HTML. I see the br tags and delete them.
These posts have not been touched since the Gutenberg update (until today,
of course).
Gary
…On Fri, Jan 4, 2019 at 3:15 PM Sylvia ***@***.***> wrote:
@glsonn <https://github.com/glsonn> Did you open those posts and update
anything in them or maybe just exit the post? Seems like it's happening
right in there someplace. On mine the tags got added after I updated the
post in any way.
Even if I didn't update anything in that post, I have to click the Update
button. You get the "Are you sure you want to leave" box if you don't.
So even though I may just have opened them to look (like the babysitter
post) - I had to click the Update button to exit the editor.
hth
Sylvia
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeYGdBmLFFC1yxTOO0OHZq0KxHUcpks5u_8RxgaJpZM4WARet>
.
|
"UNTIL I update that post without converting it to Gutenberg blocks." Yes that's exactly when it happens. The problem is that it will keep adding them back even if you keep editing them to remove them. If you delete the br tags and press the update button it'll just add them all back. The way around it is to warp the ad code in It's finicky though. Sometimes it is also adding some p tags in there too and you need to get rid of those. Sadly this means if you edit old posts you are going to have to keep performing this fix on every one you open. I don't even think you have tp press the update button. If you wait one minute it autosaves and I think that also adds the tags. |
That will probably help @glsonn. As for me, I'm updating old posts to
Gutenberg as fast as possible and resisting the urge to open pre-Gutenberg
posts. lol As long as they are still showing for now and until I get to
convert the posts, I'm happy. ;)
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Fri, Jan 4, 2019 at 3:45 PM shuttermuse ***@***.***> wrote:
"UNTIL I update that post without converting it to Gutenberg blocks."
Yes that's exactly when it happens. The problem is that it will keep
adding them back even if you keep editing them to remove them. If you
delete the br tags and press the update button it'll just add them all back.
The way around it is to warp the ad code in AD CODE by using the HTML
editor view on your one giant classic block.
It's finicky though. Sometimes it is also adding some p tags in there too
and you need to get rid of those
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apd9rjtdcfpc4APL77-LI5WovxAXUF-Kks5u_8tdgaJpZM4WARet>
.
--
Home Sweet Decor
https://home-sweet-decor.com
Creative Costume Ideas
https://creative-costume-ideas.com
Fancy Gift Wrap
https://fancygiftwrap.com
|
"I'm updating old posts to Gutenberg as fast as possible" Can you explain this? What do you mean updating them? As far as I can see, if you open an old post then it breaks the ads. |
I guess for now I'll edit them to remove the tags and then leave them alone
until the situation is corrected.
Or if I really have to edit them, make sure to delete the tags again.
Gary
…On Fri, Jan 4, 2019 at 3:56 PM shuttermuse ***@***.***> wrote:
"I'm updating old posts to Gutenberg as fast as possible"
Can you explain this? What do you mean updating them? As far as I can see,
if you open an old post then it breaks the ads.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoeyeRO-jZKf0FIGONs4wDM0xwgbjXJTks5u_84JgaJpZM4WARet>
.
|
For what it's worth, I also have Amazon on this now too and they are looking into it. I'm not sure WordPress is going to correct this because it seems to be the behaviour they desire. If Amazon can adjust their own script to still display the code even when there are line breaks in it, that might end up being the answer. I have spent all morning going back through old posts and painstakingly fixing them. |
Oh sorry, by updating old posts I mean that I'm breaking up that giant classic block into the appropriate Gutenberg blocks. The posts need product updates anyway, so they get a good freshening up and changed over to Gutenberg. It goes faster than I thought it would & it's not as hard as I thought it would be. whew Best, |
@SylviaMayfield Ah ok, got it! Thanks. |
I'm currently investigating this issue, and can reproduce the problem. I've tracked it down to a combination of problems stemming from Gutenberg's port of the the For context, Gutenberg does not perpetuate the automatic The port:
Underlying issues with wpautop The above would resolve issues with newlines being converted to Relevant Trac ticket: https://core.trac.wordpress.org/ticket/2833 For this reason, it's likely that a fix would involve a coordinated effort to resolve the issue across both the PHP and JavaScript implementations. As far as immediate action items, I have a working resolution to the specific issue of the problematic ported implementation, which would resolve the addition of |
Correction: They are supported, but the first of the linked code snippets escaped the backreference, so it was not matched. The pull request at #15129 should resolve all issues here, including the addition of both |
Hey, @aduth Thank you for your PR! Any chance to see it merged, looks like it have only changelog merge conflicts out there?
|
I'm assuming this issue still isn't resolved? I'm on a fresh copy of WordPress, and when I copy code from a service (ServiceInBlue) and I paste it into the HTML code editor, it keeps adding those pesky |
Similar problem here with WordPress 5.6.1, Twenty Twenty-One 1.1, no plugins. Some old pre Gutenberg post has content like this (simplified):
Post works fine in frontend, shows text and alerts "1". Testcase 1:
View source of preview in browser shows broken script with added tags:
Testcase 2:
View source of frontend in browser shows same as case 1, broken script with added tags. |
We also ran into this issue a couple days ago on WP 5.6.0. Easy enough to manually fix on a case-by-case basis, but it threw me through a loop at first. |
This bug seems to persist on 5.7.2. |
I had this also with a overwritten PHP template from Download Monitor. The PHP template had a newline in it, because it was visualy formating my code in my PHP file.
And voila, a Ciao! |
Well heck, these breaks and extra paragraph tags are even showing up in my Gravity Forms Gutenberg output on the front-end. I will try to do some extra research for some more information. Kinds regards, Jaime |
I encountered this issue today with wp 6.0.1 It is in the DB without Is there any good workaround out for it? |
I'm seeing this same issue appear in an HTML block inside a widget. |
Apologies if this has been covered. I did search.
I activated Gutenberg for a site that has been in existence for a while. That is, it already had existing posts and pages. It wasn't a brand new site.
I edited an existing Post that had an Amazon native search ad script at the bottom. After Updating, I viewed the post and noticed the ads were apparently missing.
The script code was still there, but a br tag had been added after each line. The script from Amazon was multi-line, broken after each semicolon.
I deleted the tags and all was fine. I then deactivated Gutenberg (for now).
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: