Hello everyone,
I am having trouble escaping and displaying wikitext in a way that is
JSON-safe. I did some research but none of the provided
MagicWords/ParserFUnctions/etc seem to be suited for this purpose.
Please refer to my gitLab snippet <https://gitlab.com/snippets/1723632>
to see the sample code of the query, template and widget.
My goal is to build up a structure like this using a widget (to load my
custom JS), a cargo query and finally a template to display the items
row by row:
<div class="item" data-item='{"content":"data from a mediawiki form
field"}'>Description</div>
<div class="item" data-item='{"content":"data from a mediawiki form
field"}'>Description</div>
The data is taken from a PageForms textarea form field (the user can
enter any data she wants). This piece of HTML gets parsed by a custom
Java Script on page load for further processing. As soon as characters
like single (') or double quotes (") appear, the whole JSON string gets
messed up and the JavaScript JSON parser throws errors. Even worse, the
DOM structure becomes fragmented when single quotes appear. So
client-side fixing w/ JavaScript is impossible/tedious.
Any solution is welcome, also restricting the types of characters used.
Ideally, I would just need to wrap the parameter passed from the query
to the template in some kind of Magic Word which escapes/strips out
unwanted characters.
What options do I have ? I am open for different approaches...
Kind regards,
Tom
Hi,
Amir Ladsgroup <ladsgroup at gmail.com> wrote:
> One note particularly about this incident, I personally would be happy if
> Yaron thought the wording is wrong, put the file back with a better
> wording, like "gerrit part of development of this extension is covered by
> the WM CoC".
Maybe I'll do that, now that I know it's an option.
> For me personally
> and after this stuff, I wouldn't touch any code Yaron is developing
outside
> of gerrit with one-yard stick but I'm fine with making patches in gerrit
in
> his extensions because I know it's covered by CoC.
This looks to me like a violation of the Code of Conduct. I don't want to
cause more drama in this discussion, especially since it seems like a sort
of consensus has formed and we can all move on, but I do find it disturbing
that a member of the Code of Conduct Committee, who is tasked with
enforcing the rules, is himself willing to engage in personal attacks.
-Yaron
Recent threads have demonstrated there seems to be some disconnect about
what is expected about maintainership and ownership of repositories.
This has spilled over into talk about the code of conduct, IMHO
specifically because some people are trying to avoid being bound by it or
protesting its existence by looking for loopholes to avoid it. Which I
think is a shame, but I don't expect much constructive talk to come out of
that thread.
I think we should though clarify that code repositories on gerrit and
diffusion are not owned by any one person, but are technical community
spaces held in common for the benefit of the Wikimedia movement. And yes,
that means sometimes your favorite project will get documentation commits
you personally didn't like.
If this has been unclear, it should be made clear. If that means some
people host their self-maintained code outside of Wikimedia technical
spaces, then that is their decision and I respect it.
If some kind of official kerfluffle is needed to decide this, let's talk
about how to do that.
-- brion
Hello,
I had a lot of interactions this week with various people, specially
since I have spamed a lot of mediawiki extensions with random patches.
So this is my thank you thread to a few people, feel free to reply with
your own thanks to others so we all get a nice week-end.
Thank you Yaron Koren for starting a conversation about the code of
conduct file and specially how it could be rephrased to better fit all
use cases. That and other suggestions are going to improve our interactions.
https://lists.wikimedia.org/pipermail/wikitech-l/2018-June/090086.html
Marco Aurelio, who has been dramatically helping to archive a few
outdated/no more working extensions. The workflow is nice, makes sure
nothing get missed and he knows authors to contact to get a confirmation.
http://phabricator.wikimedia.org/tag/cleanup is great!
Stephan "Foxtrott" Gambke, co author of the Lingo extension
https://www.mediawiki.org/wiki/Extension:Lingo If you don't know about
it check it out, that let you defines a glossary of term quite easily
with a mouse over popup on defined terms. He gracefully accepted a few
fixes to the extension.
Thank you everyone!
--
Antoine "hashar" Musso
> I for one think that requiring a specific filesystem structure or notice in
> a git repo is quite far afield from the sorts of things that CoC is
> designed to deal with.
I agree. I do think that as a community of practice we have many
unwritten rules and numerous expectations of how we work together. We
don't explicitly define the expectation of a README.MD file in repos
either.[0] It's a best practice and cultural expectation in our spaces
to include one. The code works the same with or with out it.
Yeah, sure a coc.md isn’t “the same”, but both are expected as
something we do as a community. If we need to write that down
somewhere so there's no repeat confusion on if it's expected or not,
that seems like a good compromise. However, I'd like to think we don't
have to define everything, but ¯\_(ツ)_/¯ .
[0] I'm waiting for someone to contradict me on this risky comparison.
:) I could not find anything explicit in
https://www.mediawiki.org/wiki/Gerrit/New_repositories or
https://www.mediawiki.org/wiki/Manual:Coding_conventions
Yours,
Chris K.
Well, thanks gents for the replies. It looks like I was wrong in
assuming we were on the same page.
I lack the emotional energy to keep up with this discussion for now. I
appreciate Yaron taking the time to be open to my questions and
conversations. I hope you can figure it all out. Have a good weekend.
Yours,
Chris Koerner
clkoerner.com
> You probably meant just "README". This is an interesting comparison. So, if
> an extension lacks a README file, and that extension's maintainer refuses
> to put one in, should the extension be deleted from the Wikimedia
> repository?
Let's back away from the ledge of deleting stuff. I'm not arguing for that here.
What I'm trying to get across (text lacks subtly) is that the
community is asking for you to include this file. You have refused on
grounds of a lack of explicit clarity. I'm trying to say not
everything is written down, nor does it need to be. The letter and the
spirt. :) Your peers are asking for your consideration of something
that impacts folks outside of your person. We have given this a great
deal of our attention and time. Please consider the advice of folks
who consider you a peer as well. Add the file not because it's
explicitly demanded of you, but because the community is asking you to
do so. It doesn't harm your code. It provides clarity around
expectations on how we work together.
There are voices not present in this very public conversation. I have
been approached by a few that do not feel comfortable participating
here. I don't want to see anyone's contributions deleted. I also don't
want to see an exception made in this particular case because we as a
community haven't written it down somewhere.
I'll ask you plainly and directly. Yaron, will you please add the file
to your repos?
Yours,
Chris Koerner
clkoerner.com