SamyPesse / draft-js-prism

Code highlighting for DraftJS using Prism
http://samypesse.github.io/draft-js-prism/
Apache License 2.0
275 stars 36 forks source link

:question: why iterate over 'childtokens'? #26

Open duncleberg opened 4 years ago

duncleberg commented 4 years ago

I have been going over this piece of code and why it's there? It seems unnecesary? If I delete it everything is exactly the same as if I would let it stay.

      let childOffset = offset;
      for (let i = 0; i < token.content.length; i++) {

const childToken = token.content[i];

processToken(decorations, childToken, childOffset);
}