extentreports-java icon indicating copy to clipboard operation
extentreports-java copied to clipboard

Fix Ids in FreeMarker templates for values greater than 999

Open N0r1uno opened this issue 2 years ago • 3 comments

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

N0r1uno avatar Oct 15 '23 13:10 N0r1uno

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?

apex-sewilliams avatar Jan 03 '24 22:01 apex-sewilliams

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?

N0r1uno avatar Jan 06 '24 11:01 N0r1uno

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

apex-sewilliams avatar Jan 11 '24 21:01 apex-sewilliams

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?

SebastianRG2 avatar Jun 15 '24 21:06 SebastianRG2

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

anshooarora avatar Jun 19 '24 07:06 anshooarora

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

SebastianRG2 avatar Jun 25 '24 20:06 SebastianRG2