Jump to content

Topic on 2017 wikitext editor/Feedback

Copying makes the visible and edited text inconsistent

23
Aron Manning (talkcontribs)

I've been trying to copy two lines from one message to the other for 10 minutes and failed with both visual and source editor. The textbox content gets messed up as soon as I start editing the copied content. If I don't edit, just Save the message, it does not change at all.

Whatamidoing (WMF) (talkcontribs)

On Wikipedia, or in this message system?

Aron Manning (talkcontribs)

In the Flow "structured discussion" editor, which I did not distinguish from the Visual Editor, as they are quite similar.

Right here. I guess there's an internal state for the editor that is not updated with the pasted content, as it is visible, but not saved. Chrome on Win

Aron Manning (talkcontribs)

This seems to have improved from last time, pasting from source editor to source editor now works, with markup, formatting, links all preserved.

Pasting formatted text, links, html content will show up with the formatting in ***both*** source and visual editor, but changing to and back between editors reveals that only the text remains, all markup is stripped.

I believe the expected behaviour is: pasting to source editor shows the markup (source) of the pasted content, and pasting to visual editor retains the markup, while showing the formatted (visual) result. Will do some more tests.

Aron Manning (talkcontribs)

Test paste link to visual: From WP:KB: on Windows, Chrome hold Alt+⇧ Shift or Alt+Control+⇧ Shift or Alt

Aron Manning (talkcontribs)

Test paste link to source: From WP:KB: on Windows, Chrome hold Alt+⇧ Shift or Alt+Control+⇧ Shift or Alt

Aron Manning (talkcontribs)

Test paste source markup to source: From WP:KB: on Windows, Chrome hold Alt+ Shift or Alt+Control+ Shift or Alt

Aron Manning (talkcontribs)

Test paste source markup to visual: From [https://en.wikipedia.org/wiki/Wikipedia:Keyboard_shortcuts WP:KB]: on Windows, Chrome hold {{Key press|Alt|Shift}} or {{Key press|Alt|Control|Shift}} or {{Key press|Alt}}

Aron Manning (talkcontribs)

Test paste link from visual editor to visual editor:


Aron Manning (talkcontribs)

Paste from visual editor to visual editor: From WP:KB: on Windows

Paste from rendered html to visual editor: From WP:KB: on Win, Chrome hold Altor Alt+⇧ Shiftor Alt+Control+⇧ Shift,

Copy-Paste simple text from this visual editor to itself: from rendered html to visual editor

Copy-Paste link from this vis editor to itself:

Note: At this point - after deselecting the link - the visible html widget was updated with the plain - no link - text.

Note 2: Pasting a link will add style="background-repeat: no-repeat, repeat; [... many background styles]" to the <A> element, repeating the tiny arrow behind the link text, making it unreadable. This is unnecessary, the .external style takes care of it. Just editing a previous message won't add inline style to the links.

Aron Manning (talkcontribs)

This confirms: markup is stripped in both source and visual editor, but the proper, formatted html is show (in both), until the text is selected and deselected, when it is replaced with the plain stripped text.

Copying from source to source editor works properly.

Pasting from notepad is lost, see below.

Aron Manning (talkcontribs)

Pasting from notepad:

Aron Manning (talkcontribs)

Try again:

Aron Manning (talkcontribs)

From notepad to source editor:

Aron Manning (talkcontribs)

Paste from rendered html From notepad:

Aron Manning (talkcontribs)

It seems its pasted in the wrong element: Yes, it's not wrapped in a <span class="ve-ce-branchNode ve-ce-contentBranchNode ve-ce-paragraphNode">

Aron Manning (talkcontribs)

Note: this thread wastes a lot of space, and should be removed or archived once this is fixed.

Whatamidoing (WMF) (talkcontribs)

Fixing the wikitext-to-wikitext-mode pasting problem requires dev time, and this tool isn't getting much attention right now. Certain kinds of wikitext get "sanitized" in this editing system before being saved.

Aron Manning (talkcontribs)

These tests show the problem with sanitization is upon pasting the text. My first observations mentioned saving, but it happens earlier.

2. It's still not clear to me, how this flow-editor (both source and visual) are related to the standard wikitext editor (both source and visual). Is it the same software in some parts, or completely different? The design (toolbar icons) are the same, the only difference I see is a more extensive toolbar in wikitext editor.

The point of me asking this is: should I move this thread (the above Flow editor tests) to an appropriate Flow feedback talk page (which I did not find...)?

3. I saw the Flow was tested and rejected an enwiki. While I sense the community's unwillingness to change, the inability to copy-paste into chat would be a deal-breaker for me too. I'm interested how this and the ellipsis menu UX can be fixed.


Whatamidoing (WMF) (talkcontribs)

The Flow (aka Structured Discussions) editor is sort of the visual editor, with a smaller toolbar. But it doesn't (currently) store the contents in wikitext, so if you give it wikitext or want to extract wikitext, then it runs the relevant parts of the database record through Parsoid to get wikitext. The differences between the two parsers is small and diminishing (eventually, the "two parser" problem will be solved by removing the old one and doing everything in wikitext), but there are a few quirks at the moment, including the fact that it "sanitizes" unbalanced HTML. So if, for example, you were to paste in part of a wikitext structure – maybe [[link or {{template – it may behave unexpectedly.

You can type <pre> tags (the wikitext and HTML code) to trigger a window that will let you paste in whatever fragments of code you want to discuss.

Aron Manning (talkcontribs)

My test was to copy a link from the flow discussion in the web browser (thus html) to the editor. The resulting problem (the pasted content not wrapped in a span) could be observed without saving the message. That unwrapped content was ignored/trimmed by the conversion. I would assume the database was not involved in this process, otherwise editing would be very slow with a web request on each edit. I think this was a bug in the javascript implementation of the editor. Once I'll take the time and find the bug in the code, but now I only have the observation. Furthermore, I can't reproduce it atm. Maybe it has been fixed?

Thanks for introducing me to Parsoid, btw.

Aron Manning (talkcontribs)

Seems to be fixed. Text is not wrapped in a <span> inside the <p> elements now. Text I paste into either VE or SE is kept and converted, when I switch to the other editor (both ways).

Aron Manning (talkcontribs)
Reply to "Copying makes the visible and edited text inconsistent"