Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having Roam42 SmartBlock with JavaScript shared breaks the build #42

Closed
Stvad opened this issue Mar 17, 2021 · 0 comments
Closed

Having Roam42 SmartBlock with JavaScript shared breaks the build #42

Stvad opened this issue Mar 17, 2021 · 0 comments
Labels
bug Something isn't working build mdx parsing
Projects

Comments

@Stvad
Copy link
Member

Stvad commented Mar 17, 2021

a few aspects here:

  • xml-like syntax of smartblock is failing to parse.
  • then on the fallback - I try to escape the symbols but they are already escaped, so generated code ends up with double escape translating into the escape of backslash instead of escape of

example block

 <%J:```javascript
let reg_parent_string = new RegExp('\`\`\`clojure\\s(.+)\`\`\`','s');

let query;
try{
  query = window.datomicQuery.getParentBlock()[0][0].match(reg_parent_string)[1];
} catch (err) {
  return 'ERROR - make sure you run the query from a block nested immediately under your query. Also check that common functions on [[Template/Datomic Query]] are running.';
}

//Execute query
let results;
try { 	
  results = window.roamAlphaAPI.q(query);
} catch (err) {
  return err;
}

return window.datomicQuery.processResults(results,query) + ']]]]';```%>
@Stvad Stvad added bug Something isn't working parsing build mdx labels Mar 17, 2021
@Stvad Stvad added this to In progress in Roadmap Mar 17, 2021
@Stvad Stvad changed the title Having SmartBlock with JavaScript sharde breaks the build Having SmartBlock with JavaScript shared breaks the build Mar 18, 2021
@Stvad Stvad changed the title Having SmartBlock with JavaScript shared breaks the build Having Roam42 SmartBlock with JavaScript shared breaks the build Mar 18, 2021
@Stvad Stvad closed this as completed Mar 20, 2021
Roadmap automation moved this from In progress to Done Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build mdx parsing
Projects
Development

No branches or pull requests

1 participant