markhavemann Posted June 6, 2023 at 08:43 AM Report Share Posted June 6, 2023 at 08:43 AM Is there some way to be able to edit the HTML of a post? Sometimes when pasting content from other places it can be really difficult to get it to look right, and occasionally things will look ok in the editor but be broken when you actually submit the post or the changes. Quote Link to comment Share on other sites More sharing options...
roddy Posted June 7, 2023 at 08:34 AM Report Share Posted June 7, 2023 at 08:34 AM Theoretically yes, but it's not something I'd be keen to turn on. What specifically are you trying to do? Quote Link to comment Share on other sites More sharing options...
markhavemann Posted June 7, 2023 at 01:32 PM Author Report Share Posted June 7, 2023 at 01:32 PM On 6/7/2023 at 4:34 PM, roddy said: Theoretically yes, but it's not something I'd be keen to turn on. What specifically are you trying to do? Copying and pasting tables from word (the best way to keep them formatted nicely) is a bit unpredictable. Pasting one table is fine but pasting another table does some weird things. It either puts them next to each other or creates a huge amount of space between them, and no matter how much tweaking I do I can't seem to get it to display decently. Usually the extra space is invisible in the editing pane and only shows up after you submit. I also get "phantom" cells popping up that can't be deleted if I delete empty rows in a table. Selecting the table, including new lines above and below and pressing delete will only delete the new lines most of the time. The only thing I can do is delete a big chunk above and below the cell, and that usually gets it. I can understand why you wouldn't want to turn HTML editing on since 95% of the time things are better without it. It sure would make things easier for that 5% of the time though. Quote Link to comment Share on other sites More sharing options...
markhavemann Posted June 16, 2023 at 08:42 AM Author Report Share Posted June 16, 2023 at 08:42 AM I found the solution to part of this. It turns out pasting from Word does it's best to keep every aspect of formatting. This includes text wrapping of a table. Word had set it to wrap text around the table, and so it was floating things to the right of my table after pasting to the site. There are still some small issues but mostly it's manageable now. Quote Link to comment Share on other sites More sharing options...
Demonic_Duck Posted June 16, 2023 at 09:57 AM Report Share Posted June 16, 2023 at 09:57 AM There's a hacky way to do it: Open the editor/submit-reply text box In Chrome or Edge, press Ctrl+Shift+C Hover over the editable area, then click (the blue hover indicator should show the whole editable area) Check that the selected element (in dev tools Elements pane) is named something like <div class="cke_wysiwyg_div cke_reset cke_enable_context_menu cke_editable cke_editable_themed cke_contents_ltr" ... Right click on that element in the dev tools pane, then click Edit as HTML from the context menu Edit the inner HTML of that element (i.e. don't change the element itself or any of its attributes) Save/submit the post This gives you finer-grained control, but doesn't guarantee the HTML will be exactly what you submitted, as some sanitization is performed, which is necessary to prevent bad actors from injecting scripts, messing with the site layout, etc. But it does allow you access to some handy features that aren't supported by the editor, such as code blocks and abbreviations: <abbr title="HyperText Markup Language">HTML</abbr> HTML 1 Quote Link to comment Share on other sites More sharing options...
markhavemann Posted June 17, 2023 at 12:49 AM Author Report Share Posted June 17, 2023 at 12:49 AM On 6/16/2023 at 5:57 PM, Demonic_Duck said: There's a hacky way to do it: Nice, didn't even think of that. I'll give it a try next time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.