sverweij / mscgen_js

text => sequence charts
https://mscgen.js.org
GNU General Public License v3.0
206 stars 25 forks source link

Export is not working when using non-breaking space #257

Closed eyssette closed 5 years ago

eyssette commented 5 years ago

When using a non-breaking space (in a label), the sequence chart is rendered, and it's possible to save it. But, whatever format i choose (svg, png, jpeg), the file is “corrupted” and i'm not able to open it.

sverweij commented 5 years ago

Hi @eyssette - thanks for raising this.

I've tried to reproduce the problem, but were not able to (used both alt-0160 and alt-255 for the non breaking space on a windows (7) machine in chrome (73))

This probably means there's a difference between your environment and mine. In order to narrow down the root cause, could you provide:

eyssette commented 5 years ago

Source : msc{ a[label="Test test"]; }

Error with the svg rendering : error on line 5 at column 22: Entity 'nbsp' not defined

My platform : Mac (OX 10.14.4), browsers (Chrome, Firefox, Opera):same issue.

Thanks for trying to solve the problem! Your app is wonderful, i love it!

eyssette commented 5 years ago

The source with two different non-breaking space on a mac: https://www.dropbox.com/s/p8al77p8zjsfkrv/test-msc.txt?dl=0

sverweij commented 5 years ago

Thanks - that's helpful!

sverweij commented 5 years ago

hi @eyssette - I've fixed the issue for mscgen.js.org (3.1.8 - you can see which version is served to you in about) - as far as I can tell. Please let me know if it doesn't work for you.

(note: I'm still looking for a nicer fix within the mscgenjs library - and I still have to patch the command line interface and the atom plugin likewise (probably)).

eyssette commented 5 years ago

Thank you! It works !! By the way, i don't know if you're interested in how people use your great app. But, if so, as a philosophy teacher, i use it to represent discussions between different philosophical positions or to represent the confrontation between a thesis and different objections. It is a great way to visualize the process of thought !

sverweij commented 5 years ago

Hi @eyssette - I'm very interested in how mscgen.js is used! I bumped into this tweet, which I guess is yours? If so - that is one of the more creative use cases I've seen yet; I love it :-)

Can I use it as one of the examples?

eyssette commented 5 years ago

You can use it as an example, of course. I would be honored! The code is in the speaker notes of my last slide in this document : https://docs.google.com/presentation/d/11EowxLec00XugEkyHsyDzBirG6fo_gCEGtaZ4hi5DZw/edit?usp=sharing

Here is another example, in political philosophy : https://docs.google.com/presentation/d/1pAKJvdBh9x__axArA_h4F52l105DEN29s-BDCWAhATw/edit?usp=sharing

eyssette commented 5 years ago

And a last example, to teach the process of constructing a definition :

https://mscgen.js.org/?lang=xu&mirrorentities=true&style=lazy&msc=msc%20%7B%0A%20%20hscale%3D%221.7%22%2C%0A%20%20width%3D%22auto%22%2C%0A%20%20arcgradient%3D%2210%22%3B%0A%0A%20%20a%20%5Blabel%3D%22Propositions%20de%20d%C3%A9finition%22%2Ctextbgcolor%3Dblack%2Ctextcolor%3Dwhite%5D%2C%0A%0A%20%20b%20%5Blabel%3D%22Objections%22%2Ctextbgcolor%3Dblack%2Ctextcolor%3Dwhite%5D%3B%0A%0A%20%20---%20%5Blabel%3D%22%20%20%201)%20Trouver%20le%20genre%20%20%20%22%2Ctextcolor%3D%22%23333333%22%5D%3B%0A%0A%20%20a%20rbox%20a%20%5Blabel%3D%22Le%20bonheur%20est%20un%20%20%C3%A9tat%20de%20satisfaction%22%5D%3B%0A%0A%0A%0A%20%20---%20%5Blabel%3D%22%20%20%202)%20Trouver%20autre%20chose%20du%20m%C3%AAme%20genre%20%20%20%22%2Ctextcolor%3D%22%23333333%22%5D%3B%0A%0A%20%20a%20%3D%3E%20b%20%5Blabel%3D%22Objection%20!%22%2Clinecolor%3D%22maroon%22%2Ctextcolor%3D%22maroon%22%5D%3B%0A%0A%0A%0Ab%20rbox%20b%20%5Blabel%3D%22Le%20plaisir%20est%20aussi%20un%20%C3%A9tat%20de%20satisfaction%2C%20mais%20il%20faut%20distinguer%20le%20plaisir%20du%20bonheur%22%5D%3B%0A%0A%0A%0A---%20%5Blabel%3D%22%20%20%203)%20Trouver%20les%20diff%C3%A9rences%20%20%20%22%2Ctextcolor%3D%22%23333333%22%5D%3B%0A%0A%20%20b%20%3D%3E%20a%20%5Blabel%3D%22Nouvelle%20hypoth%C3%A8se%20!%22%2Clinecolor%3Ddarkgreen%2Ctextcolor%3Ddarkgreen%5D%3B%0A%0Aa%20rbox%20a%20%5Blabel%3D%22Le%20bonheur%20se%20distingue%20du%20plaisir%20par%20la%20dur%C3%A9e%20%3A%0A%0A%20%20c%27est%20un%20%C3%A9tat%20de%20satisfaction%20durable%2C%20tandis%20que%20le%20plaisir%20est%20%C3%A9ph%C3%A9m%C3%A8re%22%5D%3B%0A%0A%7C%7C%7C%3B%0A%0Aa%20rbox%20a%20%5Blabel%3D%22Le%20bonheur%20se%20distingue%20du%20plaisir%20par%20son%20ampleur%20%3A%20c%27est%20un%20%C3%A9tat%20de%20satisfaction%20global%2C%20tandis%20que%20le%20plaisir%20est%20partiel%22%5D%3B%0A%7C%7C%7C%3B%0Aa%20rbox%20a%20%5Blabel%3D%22Le%20bonheur%20se%20distingue%20du%20plaisir%20par%20sa%20source%20%3A%20c%27est%20un%20%C3%A9tat%20fond%C3%A9%20sur%20un%20jugement%20g%C3%A9n%C3%A9ral%2C%20tandis%20que%20le%20plaisir%20est%20caus%C3%A9%20par%20un%20fait%20particulier%22%5D%3B%0A%7D