This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This function takes messy Word HTML pasted into a WYSIWYG and cleans it up | |
# It leaves the tags and attributes specified in the params | |
# Copyright (c) 2009, Radio New Zealand | |
# Released under the MIT license | |
require 'rubygems' | |
require 'sanitize' | |
def clean_up_word_html(html, elements = ['p', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], attributes={}) |