Skip to content

Support multiline embedded HTML tags #350

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

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

BertrandSim
Copy link
Contributor

As far as I know HTML tags spanning multiple lines are valid. For example,

<div class="averylongclass"
id="averylongid">
  foo
</div>

is valid HTML.
Currently, only single line HTML tags are highlighted, while multiline tags are not. This PR highlights embedded multiline tags.

As far as I know HTML tags spanning multiple lines are valid. For example, 

```
<div class="averylongclass"
id="averylongid">
  foo
</div>
```

is valid HTML. 
Currently, only single line HTML tags are highlighted, while multiline tags are not. This PR highlights embedded multiline tags.
@alerque
Copy link
Member

alerque commented Feb 1, 2021

Does this mess with highlighting Markdown inside HTML wrapper tags? It's not uncommon for Markdown documents to do things like wrap whole sections in some HTML tag. The syntax highlighting should catch the start and end tags as HTML but everything in between as more Markdown. I suspect this patch will break that usage, no?

@BertrandSim
Copy link
Contributor Author

By wrapper tags, are you referring to something like this?

<section>
## title of section

The following is a list
* item one
* item two
</section>

The highlighting for the above still works as intended. (ie, HTML for <section>, markdown highlighting for the text in between, and HTML highlighting for </section>)

@alerque
Copy link
Member

alerque commented Feb 1, 2021

Yes that's the sort of thing I was thinking about.

@BertrandSim
Copy link
Contributor Author

BertrandSim commented Feb 1, 2021

Yes, this patch does not break that. Here are some screenshots to illustrate :)

image

image

The syntax highlighting captures the opening and closing <section ...> and </section> parts separately.

@alerque alerque merged commit 76812f5 into vim-pandoc:master Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants