Hi Robert and all,
I would recommend using <br /> for the following reasons:
1) Text and XML editors that highlight XML syntax in different colours will
highlight properly with <br /> but this is not always the case if you use
<br>
2) <br /> is backwards-compatible with XHTML and well-formed HTML (ie:
XHTML) is often easier to validate for errors and debug
3) Some old parsers and some coding specs require the space before the
closing slash (ie: <br /> instead of <br/>) such as the WordPress Plugin
Coding spec:
http://make.wordpress.org/core/handbook/coding-standards/html/
In my experience, I have never come across a case where using <br /> is
problematic, however, there are many cases where <br/> or especially <br>
might be problematic in older browsers and tools.
Kind regards
Doc Taxon
Am Mo., 13. März 2023 um 13:34 Uhr schrieb Strainu <strainu10(a)gmail.com>om>:
Hi Robert,
While waiting for VE devs to respond, there are a few things you could do
to narrow-down the issue:
1. Check what the diff window shows (click on Publish changes, then on the
popup "Review your changes" in the lower-left corner).
2. Check if there was actually one or more newline(s) (\n) inserted in
wikitext.In this case, the parser probably tries to simplify the wikitext
unless a hooman decided otherwise (this seems in line with the
"alienInline" you see).
Regards,
Strainu
În lun., 13 mar. 2023 la 09:37, Robert Vogel via Wikitech-l <
wikitech-l(a)lists.wikimedia.org> a scris:
Hi everyone!
Inspired by
https://www.mediawiki.org/wiki/VisualEditor/Gadgets#Implementing_a_custom_c…
I was trying to add a `<br />` into the VE using this command:
```
ve.init.target.getSurface().getModel().getFragment().insertContent( [ {
type: 'break' }, { type: '/break' } ] );
```
While it actually inserted the line break in visual edit mode, there was
not `<br />` in the wikitext after saving the page or switching to wikitext
mode within the edit session.
I also tried to implement the whole "command/tool" in an extension, but
the behavior was the same. The odd thing is that a `<br />` inserted in
wikitext mode survives the round trip. The linear data model shows it as
"alienInline" node then.
Any ideas why the official example didn't work for me?
Greetings,
Robert
_______________________________________________
Wikitech-l mailing list -- wikitech-l(a)lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave(a)lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- wikitech-l(a)lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave(a)lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/