Skip to content

Commit 8846ed2

Browse files
committed
fix id and class html attributes for heex - release v0.1.2
1 parent eefc7e2 commit 8846ed2

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v0.1.2
4+
5+
### Bug fixes
6+
7+
* Ensure HTML id and class attributes are properly handled when empty for HEEx
8+
39
## v0.1.1
410

511
### Bug fixes

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule MakeupSyntect.MixProject do
22
use Mix.Project
33

4-
@version "0.1.1"
4+
@version "0.1.2"
55

66
def project do
77
[

native/makeup_syntect/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/makeup_syntect/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "makeup_syntect"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = []
55
edition = "2021"
66

priv/extra_syntaxes/Permissive HTML.sublime-syntax

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ contexts:
586586
- match: '["''`<]'
587587
scope: invalid.illegal.attribute-value.html
588588
- include: entities
589+
- match: (?=[{{ascii_space}}]|/?>)
590+
pop: true
589591
- include: else-pop
590592

591593
tag-id-attribute:
@@ -634,6 +636,8 @@ contexts:
634636
- match: '["''`<]'
635637
scope: invalid.illegal.attribute-value.html
636638
- include: entities
639+
- match: (?=[{{ascii_space}}]|/?>)
640+
pop: true
637641
- include: else-pop
638642

639643
tag-style-attribute:
@@ -727,7 +731,7 @@ contexts:
727731
- include: tag-generic-attribute
728732

729733
tag-attribute-value-separator:
730-
- match: (?=[{{ascii_space}}])
734+
- match: (?=[{{ascii_space}}]|)
731735
push:
732736
- clear_scopes: 1 # clear `meta.class-name` or `meta.toc-list.id`
733737
- include: else-pop

test/syntaxes/heex_test.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ defmodule MakeupSyntect.Syntaxes.HEExTest do
3333
end
3434

3535
test "handles empty heex attributes" do
36-
assert lex(~s(<.dynamic_component module= function= shared="Yay" />)) == [
36+
assert lex(~s(<.dynamic_component id= module= function= shared="Yay" />)) == [
3737
{:punctuation, "<"},
3838
{:name_tag, ".dynamic_component"},
3939
{:whitespace, " "},
40+
{:name_attribute, "id"},
41+
{:punctuation, "="},
42+
{:whitespace, " "},
4043
{:name_attribute, "module"},
4144
{:punctuation, "="},
4245
{:whitespace, " "},

0 commit comments

Comments
 (0)