markdown-doclet icon indicating copy to clipboard operation
markdown-doclet copied to clipboard

How to type in "@" symbol in Intellij IDEA

Open greenlaw110 opened this issue 8 years ago • 2 comments

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 avatar Jul 11 '16 09:07 greenlaw110

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

greenlaw110 avatar Jul 11 '16 09:07 greenlaw110

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

loddar avatar Jul 12 '16 08:07 loddar