You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the string is split with ., the list is traversed and every instance of # is removed. There is one logic as to why the author wanted to split against . and not # -- the tags may have multiple classes but only one id (proper markup, anyway).
One alternative would be to have another split, this time on # if it is present in the string:
for i in str.split '.'
if '#' in i
[klass, id] = i.split '#'
id = id.replace '#', ''
classes.push klass unless klass is ''
else
classes.push i unless i is ''
Since the i.split '#' returns only a two element array, it would be safe to avoid using the ... operand on klass.
If I use
it renders as expected:
but if I switch class and id (which is the case when using htmlkup converter)
it's interpreted as one big id
The text was updated successfully, but these errors were encountered: