question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash: link to reference is nested in image when format is JSON

See original GitHub issue

How to repro

[![foo](foo)][bar]

[bar]: bar

Save above doc as tmp.md and run redpen -r json tmp.md

Log

[2017-12-12 13:15:45.717][INFO ] cc.redpen.Main - Configuration file: /usr/local/Cellar/redpen/1.10.0/libexec/conf/redpen-conf-en.xml
[2017-12-12 13:15:45.723][INFO ] cc.redpen.config.ConfigurationLoader - Loading config from specified config file: "/usr/local/Cellar/redpen/1.10.0/libexec/conf/redpen-conf-en.xml"
[2017-12-12 13:15:45.734][INFO ] cc.redpen.config.ConfigurationLoader - Succeeded to load configuration file
[2017-12-12 13:15:45.734][INFO ] cc.redpen.config.ConfigurationLoader - Language is set to "en"
[2017-12-12 13:15:45.734][WARN ] cc.redpen.config.ConfigurationLoader - No variant configuration...
[2017-12-12 13:15:45.786][INFO ] cc.redpen.config.ConfigurationLoader - No "symbols" block found in the configuration
[2017-12-12 13:15:45.789][INFO ] cc.redpen.config.SymbolTable - Default symbol settings are loaded
[2017-12-12 13:15:45.792][INFO ] cc.redpen.parser.SentenceExtractor - "[., ?, !]" are added as a end of sentence characters
[2017-12-12 13:15:45.792][INFO ] cc.redpen.parser.SentenceExtractor - "[', "]" are added as a right quotation characters
[2017-12-12 13:15:46.101][WARN ] cc.redpen.parser.markdown.ToFileContentSerializer - Failed to add parent for a Section
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:418)
	at java.util.ArrayList.get(ArrayList.java:431)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:412)
	at org.pegdown.ast.RefLinkNode.accept(RefLinkNode.java:33)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:452)
	at org.pegdown.ast.SuperNode.accept(SuperNode.java:43)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:300)
	at org.pegdown.ast.ParaNode.accept(ParaNode.java:35)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
	at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:315)
	at org.pegdown.ast.RootNode.accept(RootNode.java:51)
	at cc.redpen.parser.markdown.ToFileContentSerializer.toFileContent(ToFileContentSerializer.java:90)
	at cc.redpen.parser.MarkdownParser.parse(MarkdownParser.java:79)
	at cc.redpen.parser.BaseDocumentParser.parse(BaseDocumentParser.java:58)
	at cc.redpen.RedPen.parse(RedPen.java:131)
	at cc.redpen.Main.getDocuments(Main.java:221)
	at cc.redpen.Main.run(Main.java:196)
	at cc.redpen.Main.main(Main.java:60)

Environment

OS

macOS 10.12

redpen

v1.10.0 (installed via brew install)

Java

java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rhysdcommented, Dec 15, 2017

After upgrading redpen via Homebrew, it backs to work fine now. Thank you for your quick fix 👍

1reaction
takahi-icommented, Dec 14, 2017

I will release the new version of RedPen containing this hotfix soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
nested loop takes too long and almost crashes the browser
My app is retrieving json data. The json file have almost one thousand words with a strucuture like this: {"THEMES":{"THEME1":["ITEM1" ...
Read more >
JSONObject - Android Developers
Creates a new JSONObject with name/value mappings from the JSON string. ... garbage collection determines that there are no more references to the...
Read more >
JSON and serialization - Flutter documentation
How to use JSON with Flutter. ... Generating code for nested classes; Further references ... The following sample JSON implements a simple user...
Read more >
Import Json to excel and export excel to Json (Updated 2022)
Extract it, open VBA code editor in excel (Alt + F11) and import the library as shown in the gif below. Add a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found