extent-framework / extentreports-java

Extent Reporting Library, Java
http://extentreports.com
Apache License 2.0
220 stars 126 forks source link

Fix Ids in FreeMarker templates for values greater than 999 #413

Closed N0r1uno closed 2 months ago

N0r1uno commented 10 months ago

Depending on locale setting, current conversion of ids can result in point or comma separated numbers. This breaks things like json code blocks because of invalid JS function naming (e.g. jsonTreeCreate1.000())

Behaviour can be reproduced by the follwing code:

for (int i = 0; i < 1000; i++)
  MarkupHelper.createCodeBlock("{ 'key': 'value' }", CodeLanguage.JSON).getMarkup();
System.out.println(MarkupHelper.createCodeBlock("{ 'key': 'value' }", CodeLanguage.JSON).getMarkup());

Fixed by setting formatting options in affected .ftl files

apex-sewilliams commented 8 months ago

I am running into this too. It looks like there was an issue with the build but it does not look like it's with anything you touched. Are you able to rerun the build to see if it passes now?

N0r1uno commented 8 months ago

Yep, that failure looks unrelated. I think I am not able to do anything here. @anshooarora could you maybe take a look at it again?

apex-sewilliams commented 8 months ago

@N0r1uno are you able to close the PR and open a new one? Maybe that will unstick something?

SebastianRG2 commented 2 months ago

Does this change have any follow-up or any other PR? Can we move forward with this or is there an alternative solution?

What is the stop of this change?

anshooarora commented 2 months ago

I'm not quite sure why this build failed and I see no errors generating this template. Merging.

SebastianRG2 commented 2 months ago

Hi, its possible to create a new release where the ‘Fix Ids in FreeMarker templates for values greater than 999’ is included, so that we can consume the library with this fix?

@anshooarora