-
Notifications
You must be signed in to change notification settings - Fork 530
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
paragraphs instead of <br> #34
Comments
IMO make this a configurable defaulting to paragraph. Another helpful idea would be shift+enter to do a line break. |
+1 (just like ckeditor or the default functionality on contenteditable fields) |
Not sure if Mercury overrides the default browser behavior, but I know that different browsers implement this their own way. I don't know which one, but there was one browser that actually inserts br tags, while others insert p tags (and Firefox takes the crown, inserting a p (or br) tag with some ugly meta-data set on it) |
my chrome inserts a p by default. But in mercury it inserts a br.... I would vote for zeroedins idea... ;) |
I agree that |
What if I press enter in an |
I agree with @JeanMertz +1 |
I think this can be configures with |
Yeah, but that's the problem.. not all of the browsers adhere to those "rules", so to get the behavior to be as close as possible across the board we always try and insert br tags. I'd say anyone who wants to can play around with that and let me know how it feels. In general it's advised to use one client (browser) across the board when editing content, so I'd say give it a go and see how it turns out? |
Yes. I just tested it out, and looks like Chrome and FF at least (newest versions) will respect
and will split current element (p, div, li etc.) into two when enter is pressed. ( pageEditor refers to instance of PageEditor so this code must be run after PageEditor is initialized). Maybe it should be added as a configuration option? |
There's also very similar issue with |
...and please "< b r / >" instead of "< b r >" . Needed by html validators. |
If editor emmits |
All, it's much appreciated that you're all keeping up with this. I'll point you to the relevant bits of code in Mercury and you all can potentially provide some insights as to when/how it's not doing what you're looking for. On line 37 of full.js.coffee (the full html region) you'll see we attempt to tell the client browser to always insert BR tags on return.. If your client is misbehaving on this for some reason it's a bug report for them -- or we try come up with some work around (and here's where I'd need your input). On line 149 of the same file we do some custom handling. This code is likely the cause of the issues you're seeing? Try to fork the project, or tweak it in line (to remove the webkit check) and see if this changes the behavior to your liking. Thanks all, since I don't have the issue personally I'm hoping you all can work with me to try and resolve it. |
Closing since no one seems to want to contribute to this. |
This is still an issue, I think most users when using a wysiwyg editor expect paragraphs, not a div with lots of breaks inserted. |
Awesome, I'll let you add that. Thanks for the input and contribution. :) |
@jrissler Look at my comment above - it's easy enough to enable - you just need one line of code I've provided. |
@swistak Thanks :) |
Can someone please point me to how/where I implement @swistak's one line fix mentioned above? Thanks. |
You can call it anywhere AFTER initializing mercury. IMO best way to do it is to modify layout for mercury and do
|
I tried: // Instantiate the PageEditor but in Chrome (v 26.0.1410.65) get: Any tips appreciated. |
I am intending to use Mercury to edit xhtml in an epub. There I need <\p/> tag. instead of |
Why mercury inserts a
when pressing enter? A new paragraph would be better...
The text was updated successfully, but these errors were encountered: