I am building a website in which a lot of the text comes from Word docs. The problem is that when you copy from a Word doc to WYSIWYG editor, the resulting HTML and CSS is horrible.
I want to implement a JS script that will run whenever a node (Drupal's basic page) is created or updated, to clean and optimize the data.
I've seen that I must create a custom module and use a hook.
Looking through the list of Drupal 7's hooks, I've noticed hook_node_submit()
which seems perfect but in it's documentation (here) is written:
This hook is intended for adjusting non-field-related properties.
So:
- Do I have any other method simpler than module?
- What is the correct hook I should use?