This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 71 - Pages: 5 [ 1 2 3 4 5 | Next ] - Last Post: 26-Aug-2020 17:32 Last Post By: davidekholm
AndreWolff

Posts: 1,770
Registered: 14-Dec-2007
HTML Editor can't handle existing html code
Posted: 17-Jul-2020 22:59
 
  Click to reply to this thread Reply
I did test the HTML edior with the album description of this album.

The original description with html code is enclosed.

If I open that text with he HTML editot I get what you see in screenshot HTML-Editor-Window.png

That is not what I expected!
RobM

Posts: 3,238
Registered: 4-Aug-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 01:00   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
At the end of line 9 you have two spaces after the end list tag and before the line break, remove them.

Line 10 has no end list tag

Line 12 has a missing > at the end. Also, I'm not sure if divs are allowed, I think they become
 <p><br></p> 


Anyway, make those changes and it all works except the empty div tag at the end.

Edited by: RobM on 18-Jul-2020 00:01
AndreWolff

Posts: 1,770
Registered: 14-Dec-2007
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 09:29   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Anyway, make those changes and it all works except the empty div tag at the end.
I applied your proposed corrections, but that does not solve the problem.
The corrected description has been attached.
RobM

Posts: 3,238
Registered: 4-Aug-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 11:32   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
No you have not. Delete the trailing spaces on line 9 (2017), after the </li>

You have also now deleted the end div for the Google code stuff, that whole line won’t work anyway, as I said before.

Edited by: RobM on 18-Jul-2020 10:33
AndreWolff

Posts: 1,770
Registered: 14-Dec-2007
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 14:25   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
No you have not. Delete the trailing spaces on line 9 (2017), after the </li>
Yes indeed after I removed all double spaces I see the text in the HTML editor window!

This is ridicule, every browser skips normal spaces, but the HTML editor crashes on it!

This is surely a bug in the HTML editor!

And another bug is the fact that the spelling-checker is not working.
RobM

Posts: 3,238
Registered: 4-Aug-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 14:59   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
RobM wrote:
No you have not. Delete the trailing spaces on line 9 (2017), after the </li>
Yes indeed after I removed all double spaces I see the text in the HTML editor window!

This is ridicule, every browser skips normal spaces, but the HTML editor crashes on it!

Paste
 <!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<ul>
<li>text</li> more text
<li>text</li>
</ul>
</body>
</html>
into the html validator and check it.

You will get an error
 Error: Text not allowed in element ul in this context.
From line 6, column 14; to line 6, column 23
<div class="jive-quote">text</li> more text↩<li>t</div>
Content model for element ul:
Zero or more li and script-supporting elements.

Browsers may show the text, but it is still bad coding, not a bug.
RobM

Posts: 3,238
Registered: 4-Aug-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 15:01   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
It does however validate on just spaces after the end list tag.
JeffTucker

Posts: 6,931
Registered: 31-Jan-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 16:04   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
This discussion of HTML validation is all an unproductive tangent. The fact remains that if you have a comment that already contains HTML tags, and you open it in the new HTML editor, your comment gets completely trashed, and can't be restored.

This goes beyond "bug," and enters the realm of "catastrophically bad."
RobM

Posts: 3,238
Registered: 4-Aug-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 16:37   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
jGromit wrote:
This discussion of HTML validation is all an unproductive tangent. The fact remains that if you have a comment that already contains HTML tags, and you open it in the new HTML editor, your comment gets completely trashed, and can't be restored.

This goes beyond "bug," and enters the realm of "catastrophically bad."

It does show though, that using a proper code editor, one that self closes tags, is much better than a simple text editor. If I’m writing text for a comment I just type it into the comments field. If I’m including html tags I use an editor and paste it into jAlbum.
Laza

Posts: 2,467
Registered: 6-Sep-2005
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 19:12   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I played with the html editor a bit. It seems it removes any content added within a div and adds <p> around every line. The empty lines end up as <p><br></p>
This practically breaks any code that was edited before. As we have advertised this feature with v21, we can't simply remove it altogether. However, we should warn users before editing HTML content at least, and make every editing undoable.
AndreWolff

Posts: 1,770
Registered: 14-Dec-2007
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 20:20   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
You have also now deleted the end div for the Google code stuff, that whole line won’t work anyway, as I said before.
??? The Google translate code works perfect, try it in this album.
AndreWolff

Posts: 1,770
Registered: 14-Dec-2007
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 20:26   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
I played with the html editor a bit. It seems it removes any content added within a div and adds <p> around every line.
Yes that should be changed: the html editor should check whether the initial text contains any html tag. If it finds a html tag it should add nothing.
JeffTucker

Posts: 6,931
Registered: 31-Jan-2006
Re: HTML Editor can't handle existing html code
Posted: 18-Jul-2020 20:49   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
As we have advertised this feature with v21, we can't simply remove it altogether.

People wanted to screw two pieces of wood together, but found that using a regular screwdriver was too much work.

Someone went to the hardware store, and came back with a pneumatic hammer. Some of us said, "Whoa, this might be a problem...." But we gave the pneumatic hammer to the users.

It's now clear that, while the pneumatic hammer can certainly sink a screw into a piece of wood very fast, it often completely destroys the piece of wood in the process.

We are now trying to modify the pneumatic hammer to make it work better as a screwdriver.

I think there are two kinds of HTML editor.

One kind is pure WYSIWYG, but that won't let you enter your own HTML tags, and, at least in this case, it also destroys any existing HTML tags.

The other kind is one in which the tags are all visible, and it warns you about things like tags that don't exist, tags that aren't properly closed, and even deprecated tags (please, dear dog, someone make people stop using <font> and <center>!). But it doesn't show you what the end result is going to look like on the web page.

I suspect that trying to combine the two may be doomed from the start.
Laza

Posts: 2,467
Registered: 6-Sep-2005
Re: HTML Editor can't handle existing html code
Posted: 19-Jul-2020 09:35   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
You're right. I'm aware we went into a one-way-road by allowing and even encouraging manual code insertion in comments. But allowing at least simple, inline HTML editing was one of the top requests, and we've received a lot of criticism like "jAlbum requires programming skills". I believe we could find a way to separate the two - the beginner mode with HTML editor enabled be default, and advanced mode with only HTML code hinting. Let's try to figure out this instead of dumping the whole idea.
davidekholm

Posts: 3,245
Registered: 18-Oct-2002
Re: HTML Editor can't handle existing html code
Posted: 19-Jul-2020 11:29   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
When adding support for a html editor I first scanned the Java scene, just to be discouraged. I then went for a JavaScript implementation that runs within an embedded web browser (https://quilljs.com/). This one looks good, is highly configurable and seems well supported too. We could look into another JavaScript html editor (there are a good number of them out there), please suggest, but we could also pass improvement suggestions to them before moving to another editor.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums