Skip to content

Commit 00c8a15

Browse files
authored
Update Html.hs (#16)
Strip prefixes
1 parent 20f3a30 commit 00c8a15

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Miso/From/Html.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,21 @@ instance Show HTMLAttr where
6767
[ T.unpack v
6868
]
6969
show (HTMLAttr k (Just v))
70-
| "data-" `T.isPrefixOf` k =
70+
| "data-" `T.isPrefixOf` k
71+
, Just rest <- T.stripPrefix "data-" k =
7172
mconcat
7273
[ " data_ \""
73-
, T.unpack k
74+
, T.unpack rest
7475
, "\""
7576
, " \""
7677
, T.unpack v
7778
, "\" "
7879
]
79-
| "aria-" `T.isPrefixOf` k =
80+
| "aria-" `T.isPrefixOf` k
81+
, Just rest <- T.stripPrefix "aria-" k =
8082
mconcat
8183
[ " aria_ \""
82-
, T.unpack k
84+
, T.unpack rest
8385
, "\""
8486
, " \""
8587
, T.unpack v

0 commit comments

Comments
 (0)