Skip to content
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

multi-line attributes support with "+" #318

Closed
luvarqpp opened this issue Aug 12, 2019 · 11 comments
Closed

multi-line attributes support with "+" #318

luvarqpp opened this issue Aug 12, 2019 · 11 comments
Labels

Comments

@luvarqpp
Copy link

Formatting multi-line attributes does broke them. Also rendering by code highlight is broken for them. See two screenshots and sample here:

highlighting; before code format:
multilineAttributes

result of code formatting algorithm:
multilineAttributesAfterFormat

Sample document snippet:

= RESTful Qaron API Specification
Ľubomír Varga <[email protected]>
v{project-version}, 2019-08-12
:toc: left
:doctype: book
:keywords: rest api, documentation, restdocs, integration, hal
:icons: font
:numbered:
:description: This document is short. +
              Despite description is long.

This is than first paragraph of documentation.

Multi-line attribute format is mentioned in recommended practices.

AsciiDoc Plugin Version: 0.29.4

IDE Name and Version:
IntelliJ IDEA 2019.2 (Community Edition)
Build #IC-192.5728.98, built on July 23, 2019
Runtime version: 11.0.3+12-b304.10 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.0.0-23-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1910M
Cores: 8
Registry: git.explicit.commit.renames.prohibit.multiple.calls=false
Non-Bundled Plugins: DBN, Lombook Plugin, com.oliverlockwood.plugins.jenkinsfile, im.jeanfrancois.ideaplugins.ideafullscreen, manifold.ij, org.asciidoctor.intellij.asciidoc, com.intellij.lang.jsgraphql, org.intellij.scala, Docker, training

@mojavelinux
Copy link
Member

Note that \ is the preferred line ending to continue an attribute entry. + is considered legacy.

@luvarqpp
Copy link
Author

Note that \ is the preferred line ending to continue an attribute entry. + is considered legacy.

Thanks, \ works like expected.

Can you arrange to update given recommended practices documentation? I was not able to make best guess and find origin of given page in github project.

PS: It seems that there is more than single repo with similar info. I guess from this search: https://github.com/search?q=%3Adescription%3A+This+document+catalogs+a+set+of+recommended+practices+for+writing+in+AsciiDoc.&type=Wikis

PS2: I think that this issue is not an issue, so perhaps close it?

@mojavelinux
Copy link
Member

It's documented here: https://asciidoctor.org/docs/user-manual/#splitting-attribute-values-over-multiple-lines

If you feel a documentation update is warranted, feel free to propose a revision.

@luvarqpp
Copy link
Author

I was probably not exact in my last post. I mean, I would propose change to this document: https://asciidoctor.org/docs/asciidoc-recommended-practices/#document-settings
There is stated in example, that I can use plus sign. I would change it to backslash there. And I was not able to quickly find its github source (if it is there).

PS: I will try to learn asciidoc a bit more, but time is a constrain.

@ahus1
Copy link
Contributor

ahus1 commented Aug 12, 2019

@luvarqpp - please keep this issue open. This should be possible to include in the parser; maybe even have a hint for the user to describe the modern syntax.

@ahus1 ahus1 added the bug label Aug 12, 2019
@ahus1 ahus1 changed the title multi-line attributes support multi-line attributes support with "+" Aug 12, 2019
@mojavelinux
Copy link
Member

You were clear. I was just pointing out that if you want that change, please submit a revision.

@ahus1
Copy link
Contributor

ahus1 commented Aug 12, 2019

And I was not able to quickly find its github source (if it is there).

@luvarqpp - there is an "edit" button at the top of the page. It takes to the referenced GitHub repo and page.

edit

@luvarqpp
Copy link
Author

My apology. I was searching for edit button on right side only (things like "fork me" and so on). I have done edit and I have made pull request: asciidoctor/asciidoctor.org#878

@mojavelinux
Copy link
Member

Thanks! Most appreciated! 💝

ahus1 added a commit that referenced this issue Aug 13, 2019
@ahus1
Copy link
Contributor

ahus1 commented Aug 13, 2019

I've pushed some changes to rectify this. The next version of the plugin:

  • supports both \ and + as continuations for attribute values
  • has an inspection that highlights the use of + as continuations in multi line attribute as a warning
  • offers a quick-fix (Ctrl+Enter) to change + to \ for multi line attribute values

attribute-continuation

This is NOT available as a pre-release, as I will first look into the other open issue as well.

@ahus1 ahus1 closed this as completed Aug 13, 2019
@ahus1
Copy link
Contributor

ahus1 commented Aug 13, 2019

pre-release 0.29.5 is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants