Skip to content

Commit

Permalink
feat: note in '''
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Nov 27, 2023
1 parent a75e94f commit 8bb59b2
Show file tree
Hide file tree
Showing 7 changed files with 1,939 additions and 1,256 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ prettier --write *.dbml
# Known Issues

- Project Definition will be removed, see: https://github.com/holistics/dbml/issues/285
- Triple single quote ''' pairs became one quote ' pairs
- All String can't include single quotes
- All fields will be wrapped in double quotes
- Comments will be removed

Expand Down
6 changes: 4 additions & 2 deletions index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ module.exports = {
parsers: {
[name]: {
astFormat: name,
parse: (data) => Parser.parse(data, 'dbml'),
parse: (data) => new Parser().parse(data, 'dbmlv2'),
},
},
printers: {
[name]: {
print: (path) => {
const ast = path.getValue();

return ModelExporter.export(ast, 'dbml', false);
const output = ModelExporter.export(ast, 'dbml', false);

return output.replaceAll(/Note:\s'([\S\s]+)'/g, "Note: '''$1'''");
},
},
},
Expand Down
Loading

0 comments on commit 8bb59b2

Please sign in to comment.