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 bffd3a7
Show file tree
Hide file tree
Showing 8 changed files with 1,943 additions and 1,259 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/bring-it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
- windows-latest
- ubuntu-latest
node:
- 18.0.0
- 16.13.0
- current
- lts/*
- lts/-1
exclude:
- os: ubuntu-latest
node: 16.13.0
node: lts/*

runs-on: ${{ matrix.os }}
steps:
Expand Down
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 bffd3a7

Please sign in to comment.