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

remark-align should not break blocks #203

Open
vhf opened this issue Feb 19, 2018 · 2 comments
Open

remark-align should not break blocks #203

vhf opened this issue Feb 19, 2018 · 2 comments
Labels
misc/help wanted This issue needs help semver/major This is a breaking change type/question This does not need any changes

Comments

@vhf
Copy link
Contributor

vhf commented Feb 19, 2018

Here is a regression test:

test.skip('should not break blocks such as lists', () => {
const {contents} = render(dedent`
# title
->
- list item
- list -> item
- sublist
- ->
- c
- d
<-
`)
expect(contents).toBe(dedent`
<h1>title</h1>
<div class="align-center"><ul>
<li>list item</li>
<li>list -> item</li>
<li>sublist</li>
<li>-></li>
<li>c</li>
<li>d</li>
</ul></div>
`)
})

IMO the whole list should be wrapped in a center-align. Instead, it is split in half and right-aligned, the marker after the list not being taken into account, the list (which is a block) being broken in half.

@vhf vhf added type/bug This is a problem misc/help wanted This issue needs help labels Feb 19, 2018
@AmarOk1412
Copy link
Member

Aha I just reinstalled zmarkdown and, fun thing with this issue, if you replace - -> by - -> (one space at the end, line 160) the result is correct (the whole list is wrapped in a center-align).

I think I can try to fix this tomorrow.

@AmarOk1412
Copy link
Member

@vhf I think the question is a bit difficult.

For now the rule is "simple". You write a marker to start at the begin of a line, and a marker at the end of a line.

I should be able to write something (I think):

-> - a
- b <-

to have a list of 2 items wrapped in a center-align. For your example I'll prefer:

# title 
     -> 
     - list item 
     - list -> item 
     - sublist 
     - -\> 
     - c 
     - d 
    <- 

Do you agree?

@AmarOk1412 AmarOk1412 reopened this Feb 22, 2018
@vhf vhf added type/question This does not need any changes semver/major This is a breaking change and removed type/bug This is a problem labels Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc/help wanted This issue needs help semver/major This is a breaking change type/question This does not need any changes
Projects
None yet
Development

No branches or pull requests

2 participants