Clean text pasted from word into RTE
Utility function I am currently using to clean up taste pasted from Word into a Tiny MCE enabled Text field.
- clean
- word
Utility function I am currently using to clean up taste pasted from Word into a Tiny MCE enabled Text field.
Refactors two similar django template files to use `{% block %}` tags. Takes two template files, where one is a modified version of the other, and looks for differences and similiarities between the two. It then generates refactored (and renamed) versions of each file and a third 'base' file, adding an `{% extends %}` tag as appropriate. Block tags are named with matching numbers in all 3 files, making it easy to do a search and replace with more meaningful labels. `sample_data_in_base` controls whether or not the content from file 1 is copied into place in the base file as an example. Problems: it doesn't identify open `{% for %}` or `{% if %}` tags, so this needs some manual fixing (moving the `{% endfor %}` and `{% endif %}` tags into the proper blocks). It doesn't add the correct path for the `{% extends %}` tag either (ie. `"app/base.html"`). `collapse_whitespace` is not working at all.
This adds a checkbox in the admin site that removes the reference to a file uploaded via a FileField (or ImageField). It does not delete the actual file.
rodrigoc has posted 3 snippets.