Skip to content

Instantly share code, notes, and snippets.

@alexserver
Created November 5, 2014 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexserver/ae17ea2bbca24ffc6b7f to your computer and use it in GitHub Desktop.
Save alexserver/ae17ea2bbca24ffc6b7f to your computer and use it in GitHub Desktop.
Custom configuration to remove garbage from google docs.
// Configuration for removing html tags enclosing ractive conditionals, and also for removing html tags
// Defualt.sublime-commands
// To configure the commands that will be available in the command palette (Cmd + shift + P)
[
{
"caption": "Reg Replace: Google Docs delete garbage",
"command": "reg_replace",
"args": {"replacements": ["google_docs_delete_garbage"]}
}
]
// reg_replace.sublime-settings
// To configure the searchs with regular expressions, and the replacement.
{
"replacements": {
// Example replacements
"google_docs_delete_garbage": {
"find": "<tr((?!>).)+>((?!(</tr>)|(\\{\\{((?!\\{\\{).)+\\}\\})).|\\n)+(\\{\\{\\#((?!\\{\\{).)+\\}\\}|\\{\\{\\/((?!\\{\\{).)+\\}\\})((?!(</tr>)|(\\{\\{((?!\\{\\{).)+\\}\\})).|\\n)+</tr>",
"replace": "\\6",
"greedy": true,
"case": false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment