salesforce-ux/theo

multi-line strings leads to SyntaxError

iilei opened this issue · 5 comments

iilei commented

Hi,

when I just tried to implement a custom html renderer with markdown support in the comments I came across the following:

Valid yaml with markdown inside:

# design-tokens/app.yaml
props:
  COLOR_BRAND:
    value: "{!CASPER}"
    type: color
    category: background-color
    comment: >
      folded

       * bullet
       * list

Output:

// common.js
module.exports = {
// folded

 * bullet
 * list

  colorBrand: "rgb(159, 170, 181)",
}

Which produces a Syntax Error.

I am aware it might seem like a contrived scenario. However, if you would accept a PR I would happily contribute.

Opinions?

What is the actual issue? Is the yaml parser not working?

Oh, I see, it's not creating the comment correctly to handle mutli-line strings. I'd be happy to accept a PR to fix it. Thanks!

@iilei are you still interested in creating a pull request for this feature?

iilei commented

Thanks for asking – I have been pretty busy the past weeks and honestly hadn't the time to start working on it. I might find the time until end of march tho.

iilei commented

@aputinski I am on it. See here for current state of progress.

I am going to double check my code tomorrow – if you already see potential for improvements let me know.

Thank you 🙂