/* * [UntidyScript.java] * * Summary: search/replace Script to undo effect of HTMLTidy. * * Copyright: (c) 2014-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2014-12-29 initial version */ package com.mindprod.rep; import com.mindprod.commandline.CommandLine; import com.mindprod.filter.AllButSVNDirectoriesFilter; import com.mindprod.filter.ExtensionListFilter; import java.io.File; import java.util.Arrays; import java.util.regex.Pattern; /** * search/replace Script to undo effect of HTMLTidy. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2014-12-29 initial version * @since 2014-12-29 */ public class UntidyScript extends Script { /** * list of search/replace pairs to undo * negative effects of HTMLTidy */ private static final ScriptItem[] si = { new ScriptItem( "'", "'" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "
", "
" ), new ScriptItem( "
", "\n
\n" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "", "" ), new ScriptItem( "
  • ", "
  • " ), new ScriptItem( "
      ", "
        " ), new ScriptItem( "

        ", "

        " ), new ScriptItem( "", "" ), // this as a corrector. Do not modify. new ScriptItem( "

        ", "
        " ), new ScriptItem( "~ ", "\n~ " ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "\n" ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*\\s*" ), "" ), new ScriptItem( Pattern.compile( "" ), "\n" ), new ScriptItem( Pattern.compile( "
      \\s*~" ), "
    \n~" ), new ScriptItem( Pattern.compile( "

    \\s*

    " ), "

    " ), new ScriptItem( Pattern.compile( "

    \\s*~" ), "

    \n~" ), new ScriptItem( Pattern.compile( "\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*" ), "" ), new ScriptItem( Pattern.compile( "\\s*~" ), "\n~" ), new ScriptItem( Pattern.compile( "\\s*