MarkupHelper.createCodeBlock(json,CodeLanguage.JSON); is not displaying json properly
See original GitHub issueI have used the code from the official website. http://extentreports.com/docs/versions/4/java/#markup-helpers-codeblock
String json = "{'foo' : 'bar', 'foos' : ['b','a','r'], 'bar' : {'foo':'bar', 'bar':false,'foobar':1234}}"; Markup m1 = MarkupHelper.createCodeBlock(json,CodeLanguage.JSON); testextent.pass(m1);
The report generated using this code is not displaying properly. Please find the screenshot
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
JSON Data Not Displaying Correctly in HTML - Stack Overflow
Your JSON structure is not how it should be. If the first object is how it should be (judging by the fact that...
Read more >Working with JSON - Learn web development | MDN
In this article, we've given you a simple guide to using JSON in your programs, including how to create and parse JSON, and...
Read more >JSON Files - Spark 3.3.1 Documentation
Property Name Default Scope
primitivesAsString false read
prefersDecimal false read
allowComments false read
Read more >Python Pretty Print JSON - DigitalOcean
We can use the Python json module to pretty-print the JSON data. The json module is recommended to work with JSON files.
Read more >ConvertFrom-Json (Microsoft.PowerShell.Utility)
The ConvertFrom-Json cmdlet converts a JavaScript Object Notation (JSON) formatted string to a custom PSObject or Hashtable object that has a property for ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed in 5.0.0-SNAPSHOT.
However, not all features are available yet. More here: https://github.com/extent-framework/extentreports-java/tree/v5.0.x?files=1
Hi Anshoo, Thanks for your quick response before. As you suggested, I have used ExtentSparkReporter to generate the report. But I still face the same issue.
Report config >
ExtentSparkReporter sparkReporter = new ExtentSparkReporter(reportPath); sparkReporter.config().setDocumentTitle("Sample Automation"); sparkReporter.config().setReportName("Automation Run"); sparkReporter.config().setTheme(Theme.DARK); sparkReporter.config().setEncoding("utf-8"); extent = new ExtentReports(); extent.attachReporter(sparkReporter);
Test >
testextent = extent.createTest("Code"); String json = "{'foo' : 'bar', 'foos' : ['b','a','r'], 'bar' : {'foo':'bar', 'bar':false,'foobar':1234}}"; testextent.pass(MarkupHelper.createCodeBlock(json, CodeLanguage.JSON)); testextent.log(Status.INFO,MarkupHelper.createCodeBlock(json, CodeLanguage.JSON) );
Have attached the screenshot of the report.