Abnaxos / markdown-doclet

A Doclet that allows the use of Markdown in JavaDoc comments.
GNU General Public License v3.0
318 stars 40 forks source link

How to type in "@" symbol in Intellij IDEA #65

Open greenlaw110 opened 8 years ago

greenlaw110 commented 8 years ago

The following code doesn't work:

/**
 * ```java
 * public class FilterConsumer {
 *     private List<Filter> filters;
 *     @Inject
 *     public class FilterConsumer(List<Filter> filters) {
 *         this.filters = filters;
 *     }
 * }
 * ```
 */

It gives out: image

Neither this works:

/**
 * ```java
 * public class FilterConsumer {
 *     private List<Filter> filters;
 *     &#64;Inject
 *     public class FilterConsumer(List<Filter> filters) {
 *         this.filters = filters;
 *     }
 * }
 * ```
 */

It produces: image

Or this way:

/**
 * ```java
 * public class FilterConsumer {
 *     private List<Filter> filters;
 *     {@literal@}Inject
 *     public class FilterConsumer(List<Filter> filters) {
 *         this.filters = filters;
 *     }
 * }
 * ```
 */

Which omit the @ in the rendered result: image

greenlaw110 commented 8 years ago

In the end I have to fall back to normal JavaDoc:

/**
 * <pre><code>
 * public class FilterConsumer {
 *     private List&lt;Filter&gt; filters;
 *     &#64;Inject
 *     public class FilterConsumer(List&lt;Filter&gt; filters) {
 *         this.filters = filters;
 *     }
 * }
 * </code></pre>
 */

Which produce the result I needed:

image

loddar commented 8 years ago

The problem is that markdown handles &#64; different when it's part of a (markdown) code block. Outside of a code block it's printed as '@'.

I've fixed this. So may be in the future version, you type only @ - that's it. The only necessary step is that Raffael ( @Abnaxos ) merge the pull request #64- funny, my pull request has the same number like the @ symbol ;-).

See the detailed description of the corresponding changes:

See https://github.com/loddar/pegdown-doclet/blob/cf00dfc0fd73c1ecc6dc12c10be8d3a76ca5c7e5/markdown-corrections.md