Reveal-liveCoding icon indicating copy to clipboard operation
Reveal-liveCoding copied to clipboard

LiveCoding pastes ID before/after every curly bracket

Open korbinianfritsch opened this issue 9 years ago • 1 comments

Look at the code, I write plain CSS in the code-Tag that is assigned to data-livecoding-id "#buttonLive". The ID is then injected not only before selectors, but also within animation keyframes and after closing tag of ".button".

Am I doing anything wrong or is this a bug? Thanks in advance.

201509272_200920-capturfiles

korbinianfritsch avatar Sep 29 '15 18:09 korbinianfritsch

@korbinianfritsch Not sure how helpful this is after more than 2 years after the issue was opened. The code doesn't detect that the nested brackets inside of the @keyframes isn't a selector but a value. My solution for my case is just naively checking if the selector is a class or id on this line: https://github.com/iamvdo/Reveal-liveCoding/blob/master/live-coding.js#L54 because that fits my use case:

if(selectors[j].substr(0,1) === "." || selectors[j].substr(0,1) === "#"){
    selectors[j] = '#' + demoElementId + ' ' + selectors[j];	
}

jesperorb avatar Dec 21 '17 19:12 jesperorb