Skip to content
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

Annotate issue with MathML ou LateX #47

Open
flizotte opened this issue Feb 24, 2016 · 5 comments
Open

Annotate issue with MathML ou LateX #47

flizotte opened this issue Feb 24, 2016 · 5 comments

Comments

@flizotte
Copy link

I was reported this issue in Ouwiki (2014042800) running on Moodle 2.8.9.

Teachers want to annotate pages containing MathML generated by Wiris. But an annotation mark gets inserted in the MathML syntax:

«math Annotation markerxmlns=¨http://www.w3.org/1998/Math/MathML¨»«mfrac»«mrow»«mn»25«/mn»«mo»,«/mo»«mn»0«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«mo»§#160;«/mo»«/mrow»«mrow»«mn»25«/mn»«mo»,«/mo»«mn»0«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«/mrow»«/mfrac»«mo»§#215;«/mo»«mfrac»«mrow»«mn»0«/mn»«mo»,«/mo»«mn»10«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»o«/mi»«mi»l«/mi»«/mrow»«mrow»«mn»1000«/mn»«mo»§#160;«/mo»«mi»m«/mi»«mi»L«/mi»«/mrow»«/mfrac»«mo»§#215;«/mo»«/math»

This is because there is a space between math and xmlns.

I also tested with LaTeX and I get a span before and after: .

Is there any way the annotation form could display properly MathML and LaTeX?

@jason-platts
Copy link
Member

I'm not sure how you would be able to get around this issue as in this case the mathml (or LaTeX) is inserted as text so could be annotated just like any other text.

Is there a problem with this as even if someone does add an annotation into the middle of the equation text then that doesn't actually break anything?

@flizotte
Copy link
Author

Thanks a lot for your quick reply.

The mathml (displayed by the Wiris filter) generates an error message when the filter is on.So one cannot really break it by inserting an annotation.

image

But if I temporarily turn the filter off, I can then add an annotation within the mathml tag and then it breaks. But this is not likely to happen.

image

With LateX, it is different. The equation show up, but it is surronded by two tags.
image

@jason-platts
Copy link
Member

I'm afraid I don't have a solution for this.

We use both mathml and latex without problems - but we have our own filter that converts these to images, so you can never annotate within them.

One point confuses me with your screen grab of latex - this is showing the annotation span html, but within the annotation page interface - is this a copy and paste of the html of a wiki page?

@flizotte
Copy link
Author

For LaTeX, step by step... All in wysiswig.
Edit mode
image

View mode
image

Annotate mode
image

@jason-platts
Copy link
Member

It looks like the WIRIS filter doesn't strip any other content it doesn't want/understand, it looks like our in-house maths filter does and so we hadn't noticed this problem.

I'm struggling to think of a way around this, the annotation spans need to be added before the filter is run (this is due to positioning, they are recorded based on the source text).
If there are spaces in the text the wiki code will add an annotation span regardless - I'm not sure how it would tell this particular text is an equation (other than guessing based on the contents). Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants