-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Author in header leads to wrong re-formatting #314
Comments
A first analysis shows that the author information is recognized as normal text by the lexer. This leads in the following to treating the attribute definitions as plain text, too, as attributes must not appear within a text block. A workaround is to not use the author information or not to use reformatting until this is fixed. A user can disable reformatting for AsciiDoc by disabling the checkbox "Settings..." | "Editor" | "Code Style" | "AsciiDoc" | "Enable Formatting". |
@luvarqpp - a new preview release 0.29.2 is available that is handling author information and following attribute declarations correctly: it will no longer word-wrap them. The pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository. Please give it a try and comment in this ticket if the pre-releases solves the issue for you. Thanks! |
@ahus1 thanks, I can confirm that given plugin build is OK in term of formatting author part of document. Another "magic" has happened through. I have some longer lines (200 and more characters) and I use soft-wrap (sidenote, plugin does not save soft-wrap setting during IDE restarts). After making "code" formatted by plugin (ctrl+alt+L Reformat code, on directory with documents), one line has been split to three lines. Each line after splitting contained single sentence. I consider given behavior as weird, because the other lines did not get split. Given the single line which has been split has some words in backquote/backtick and it was between two "operation" macro from spring-restdocs-asciidoctor extension (which is in .ascidoctor folder as mentioned in #310 issue). |
@luvarqpp - thanks for giving this release a try. The one-sentence-per-line is one of the patterns considered an asciidoc best practice. It allows moving around sentences easily, editing the sentence provides you with a meaningful diff view (compared to wordwrap). Having said that this feature can be disabled and enabled separately in the code style settings for asciidoc. If you have a demo snipped showing some text that was split into two lines but shouldn't, please post it in this ticket. I can the amend the rules. To make wrapping permanent: there is a general IntelliJ setting that allows you to change to wordwrap for a set of file extensions. The plugin could have given a hint for this I suppose. |
@ahus1 - you answered all my questions... |
@luvarqpp - thank for sharing you experiences. I created to tickets to enhance the UX to learn about conventions and feature "as you go". As the original bug is now fixed, I close this ticket. |
When adding author and version information to the header of the document, the reformatting scrambles it: it adds an empty line just before the author. Attributes get wrapped to a single line instead of staying in one line.
The plugin should leave the author just below the title. The attributes should stay in their own lines.
AsciiDoc Plugin Version: 0.28.27
(thanks for @luvarqpp for reporting this)
The text was updated successfully, but these errors were encountered: