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

The escape char is not showing up on the UI #91

Open
evelinec opened this issue Nov 8, 2019 · 6 comments · Fixed by #114
Open

The escape char is not showing up on the UI #91

evelinec opened this issue Nov 8, 2019 · 6 comments · Fixed by #114
Labels
Blocked by Blocked by other issue

Comments

@evelinec
Copy link
Contributor

evelinec commented Nov 8, 2019

The test class has the following line of code that uses escape char:

1 <= Integer.parseInt(metric.split("\\s+")[metric.split("\\s+").length - 1]));

It shows up on the ol.io UI as:

1 <= Integer.parseInt(metric.split("\s+")[metric.split("\s+").length - 1]));

On Linux and Mac, the later causes a code compilation error:

/root/guides/PRs/guide-microprofile-metrics/start/src/test/java/it/io/openliberty/guides/metrics/MetricsIT.java:73: error: illegal escape character
            1 <= Integer.parseInt(metric.split("\s+")[metric.split("\s+").length - 1]));
@evelinec
Copy link
Contributor Author

evelinec commented Nov 8, 2019

@steven1046 @gkwan-ibm @NimG98 FYI

@evelinec evelinec mentioned this issue Nov 8, 2019
18 tasks
@NimG98
Copy link
Contributor

NimG98 commented Nov 8, 2019

The above code is appearing correctly on the lgdev site as (\\s+).

But is showing up incorrectly as (\s+) on the QA site
https://qa-guides.mybluemix.net/guides/microprofile-metrics.html#testing-the-metrics

That line of code is new btw (added for dev mode) in branch mpMetrics2x (merged into QA)

@steven1046
Copy link
Member

I'm still looking into why this could be different on the QA environment. By the time the MetricsIT.java code gets loaded into html in the browser it already has one of the backslashes missing so it's not javascript that is doing this. And both environments have the same version of asciidoctor. I'm still lost as to why it is different but I'll keep looking.

@gkwan-ibm
Copy link
Member

temporary updated the guide by
Integer.parseInt(metric.split(" ")[metric.split(" ").length - 1]));
when this issue can be fixed by UI, the guide should be restored to
Integer.parseInt(metric.split("\\s+")[metric.split("\\s+").length - 1]));

@gkwan-ibm
Copy link
Member

pending a fix for OpenLiberty/openliberty.io#1975

@mbroz2
Copy link
Member

mbroz2 commented Jan 13, 2021

Looks like the issue is in the minifier (https://github.com/octopress/minify-html) but unfortunately it doesn't seem like it's being actively maintained anymore (though we can certainly try and open an issue).
We're also looking at switching to a different minifier (#742) which may resolve this issue.

In the meantime, I suggest changing the example/test code to avoid this scenario.

@gkwan-ibm gkwan-ibm added the Blocked by Blocked by other issue label Jun 22, 2021
@steven1046 steven1046 removed their assignment Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked by Blocked by other issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants