-
Notifications
You must be signed in to change notification settings - Fork 179
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
Broken story markup for users without unfiltered_html
capabilities
#1121
Comments
Can you post the |
I'll try to see if there is a revision where I can grab it from |
As a quick fix we could try to always push the |
@dvoytenko Quick-fix based on your suggestion: #1169 Note: I was not able to replicate the issue locally, tried toggling the bold on/off together with various |
Interestingly this popped up again on the Stories Labs site, even after we revamped the formatting. Maybe issues related to copy/paste text with formatting? Reopening for investigating. |
@swissspidy, specifically unmatched Do you have some links or more info? |
@barklund Apparently the copy-paste logic still allows See https://github.com/google/web-stories-wp/blob/d82934bfb8095687d5b7a9be3bd6653465a3adef/assets/src/edit-story/utils/copyPaste.js#L31 and related code using it. |
I didn't actually test it before, was thinking through options where could have the Did test it out now and the
|
I was able to reproduce this issue! 🎉 It's not really about Prerequisites for testing
Why Author role? Well, that role does not have the To reproduce:
Meanwhile, the database will look like this:
body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}
amp-story-grid-layer {
overflow: visible;
}
.page-fullbleed-area {
position: absolute;
overflow: hidden;
width: 100%;
left: 0;
height: calc(1.1851851851851851 * 100%);
top: calc((1 - 1.1851851851851851) * 100% / 2);
}
.page-safe-area {
overflow: visible;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: calc(0.84375 * 100%);
margin: auto 0;
}
.wrapper {
position: absolute;
overflow: hidden;
}
.fill {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: 0;
}
<amp-story standalone="standalone" publisher="Web Stories" publisher-logo-src="https://web-stories.local/wp-content/plugins/web-stories-wp/assets/images/fallback-wordpress-publisher-logo.png" title="Author Test" poster-portrait-src="https://web-stories.local/wp-content/plugins/web-stories-wp/assets/images/fallback-poster.jpg"><amp-story-page id="4bc5a275-f372-4770-baaa-534820bfb5c2" auto-advance-after="7s"><amp-story-grid-layer template="vertical"><div class="page-fullbleed-area" style="background-color:#fff"><div class="page-safe-area"><div style="width:100%;height:118.51852%" id="el-c9cf75ea-f702-46a2-9bb1-df9ccdf5efeb" class="wrapper"><div class="fill"></div></div></div></div></amp-story-grid-layer><amp-story-grid-layer template="vertical"><div class="page-fullbleed-area"><div class="page-safe-area"><div style="width:36.36364%;height:2.72727%" id="el-4942e49e-c28d-4437-a7fd-4572e48dac54" class="wrapper"><p class="fill" style="margin:0;,sans-serif;font-size:0.212121em;line-height:1.3;text-align:initial;padding:0% 0%;color:#000000"><span style="font-weight: 700">Fill in some text</span></p></div></div></div></amp-story-grid-layer></amp-story-page></amp-story>
{"version":21,"pages":[{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"c9cf75ea-f702-46a2-9bb1-df9ccdf5efeb"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Roboto","weights":[100,300,400,500,700,900],"styles":["italic","regular"],"variants":[[0,100],[1,100],[0,300],[1,300],[0,400],[1,400],[0,500],[1,500],[0,700],[1,700],[0,900],[1,900]],"fallbacks":["Helvetica Neue","Helvetica","sans-serif"],"service":"fonts.google.com"},"fontSize":14,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1.3,"textAlign":"initial","padding":{"vertical":0,"horizontal":0,"locked":true},"type":"text","id":"4942e49e-c28d-4437-a7fd-4572e48dac54","content":"<span style="font-weight: 700">Fill in some text","x":93,"y":130,"width":160,"height":18,"scale":100,"focalX":50,"focalY":50}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"type":"page","id":"4bc5a275-f372-4770-baaa-534820bfb5c2"}],"autoAdvance":true,"defaultPageDuration":7} @miina This might ring a bell for you, since we had to deal with this in the old editor as well: ampproject/amp-wp#2691 |
I reproduced this on a new test account on stories-lab.dev. Adding a text element was not necessary for me -- a completely blank story will be broken. So this might be a separate bug unless I'm missing something. My guess for the missing |
Thanks for testing! Still the same root cause though. It‘s not about specific tags, just that there‘s markup at all (of which we have plenty). |
Another manifestation of this same issue: author users cannot rotate elements. |
</strong>
tagunfiltered_html
capabilities
Note for UAT: This has been on Stories Labs for a bit now, and users already reported that they were now able to successfully create and publish stories, thanks to this change. |
Bug Description
I noticed this while debugging a story. Not sure how it happened, but in this case there was no closing
</strong>
tag on a text element.Why P0?
This broken markup led to a completely broken layout on the frontend. It was impossible to read the story.
Possibly related: #413, #1007, #1093.
Expected Behaviour
There should never be broken markup like this.
Steps to Reproduce
Drafts:
Published stories:
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria
QA Instructions
Drafts:
Published stories:
The text was updated successfully, but these errors were encountered: