salesforce-ux / theo

Theo is a an abstraction for transforming and formatting Design Tokens

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multi-line strings leads to SyntaxError

iilei opened this issue · comments

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?

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.

@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 🙂