Multiline attributes fail
See original GitHub issueFor example, this gives a “malformed attribute block” error:
%img(src="images/foo.png"
title="Some Image")
However, it works fine in Ruby Haml.
This also needs to be supported for curly-braced attribute blocks; Ruby Haml supports those being multiline as well, though it strictly enforces that each line but the last must end with a comma.
Issue Analytics
- State:
- Created 11 years ago
- Reactions:2
- Comments:13
Top Results From Across the Web
I Cannot Attribute My Multiple Lines to Attributes
When creating your Attribute you will see on the upper left side of the Dialog Box an option called Multiple-lines. This option will...
Read more >AutoCAD Tip: Multiline Attributes: When One Line Just Isn't ...
Several releases ago, AutoCAD added the ability to create an attribute definition with multiple lines of text. Join Lynn Allen as she shows ......
Read more >AutoCAD Tip -- Multiline Attributes: When One Line Just Isn't ...
Several releases ago, AutoCAD added the ability to create an attribute definition with multiple lines of text. Join Lynn Allen as she shows ......
Read more >Width factor of multiline attribute - AutoCAD Forum
Solved: I was trying to find out, how to change the width factor of multiline attribute and I failed. The only way was...
Read more >AutoCAD 2008: MATTs (Multiline Attributes) - Between the Lines
Click Draw menu > Block > Define Attributes.... · In the Attribute Definition dialog box, under Mode, select Multiple Lines. · Enter tag ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah wait, for those like me wanting to use webpack and having this error, you can use ruby-haml-loader which uses the actual
haml
gem, so you won’t have any errors at all if it works already in your Ruby app!@AnalyzePlatypus I came back to take a look, but on inspection I’d call this unfixable. haml-js is parsing documents using regexes. The core of tag matching is done by https://github.com/creationix/haml-js/blob/master/lib/haml.js#L184 which assumes that each tag exists on a single line.
Although it might be possible to match based on tag delimeters
.
,#
, or%
I’m not willing to dive into a library that translates without a parser myself. Sorry, I’d suggest not using haml with js projects 😞