> The primary purpose of this change is to make it easier to spot invalid > snippets in generated documentation. > > This adds a new `Content invalidTagOutput(String summary, Optional<String> > detail)` method to the `TagletWriter` class that returns HTML to display the > summary and optionally a detail message. The method is only used for snippet > tags for now, but is generic and could be used for other invalid tags in the > future. > > If the `detail` argument is empty or contains a blank string, a `<span>` > element is returned containing the `summary` argument. If a detail argument > is provided, a HTML5 `<details>` element is returned containing a `<summary>` > element with the `summary` argument and a `<pre>` element containing the > `details` argument. In both cases the returned element is styled with a thin > border and a light red background. > > In its current use the `detail` argument is always provided by the message of > the `ParseException` or `BadSnippetException` that was thrown and caught. > > Example output is available here: > http://cr.openjdk.java.net/~hannesw/8276964/api.01/snippet_errormessages/A.html > > I added output checks to some but not all of the negative tests. In addition > I slightly reformatted `TestSnippetTag.java` to add indentation to some > previously unindeted text blocks.
Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision: Normalize newlines on detail message ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/6579/files - new: https://git.openjdk.java.net/jdk/pull/6579/files/9dd21081..4e0344e0 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6579&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6579&range=00-01 Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/6579.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6579/head:pull/6579 PR: https://git.openjdk.java.net/jdk/pull/6579