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

Include in Activity Diagram does not work ( due to "\r" ) #379

Closed
mijlouis opened this issue Jul 18, 2022 · 2 comments
Closed

Include in Activity Diagram does not work ( due to "\r" ) #379

mijlouis opened this issue Jul 18, 2022 · 2 comments
Labels

Comments

@mijlouis
Copy link
Contributor

Hello,
first of all thanks for this amazing tool. It is very helpful.

Today I came across an issue on Windows where I try to include a stylesheet in an activity diagram.
It it related to #201.
As I have found out, the path to the included file gets not resolved due to "\r" at line end of include reference.

Error message :

' caused an error:sing of PlantUML include, because reading the referenced local file 'stylesheet.iuml
'rror: ENOENT: no such file or directory, open 'stylesheet.iuml

Please see attached sample project.

asciidoctor-kroki_cr-issue_01

The issue can be tracked down in node_modules/asciidoctor-kroki/src/preprocess.js line 125 as shown in above screen shot.

Maybe it is not the best place to fix it as shown in above screen shot but at least with the modification there it works.
Could you please check and maybe fix it where appropriate?

Thanks and Best Regards

Sample Project:
adoc-web_cr-issue.zip

@ggrossetie
Copy link
Member

Hey!

Good catch, I think we should use \s (any space character equivalent to [\r\n\t\f\v \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]) instead of \\ .

Do you want to submit a pull request? Ideally, we should add a test case in: https://github.com/Mogztter/asciidoctor-kroki/blob/master/test/preprocess.spec.js to make sure that the fix is working as expected.

mijlouis added a commit to mijlouis/asciidoctor-kroki that referenced this issue Jul 29, 2022
When a diagram is using Windows EOL line endings (\r\n) and using include
of a stylesheet, an error message is thrown reporting that the file to
include cannot be found (because of a remaining \r on the url of the
code.)
This fix adresses this issue and removes any trailing spaces, \r,\n,\r\n
in the resolved include file.
@mijlouis
Copy link
Contributor Author

Hello @Mogztter,
I have created a pull request.
Hopefully you are fine with the changes :-)
Thanks and Best Regards

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

No branches or pull requests

2 participants