summaryrefslogtreecommitdiff
path: root/www/tidy/files/patch-ac
diff options
context:
space:
mode:
authorAlexey Zelkin <phantom@FreeBSD.org>2001-11-22 15:26:43 +0000
committerAlexey Zelkin <phantom@FreeBSD.org>2001-11-22 15:26:43 +0000
commit29ff18f4bd95463fe6b2fe2fc22470499aa5e710 (patch)
tree596622673e2a261cc0eb06cb32c1a7b307035bf3 /www/tidy/files/patch-ac
parentAdd new option '-preserve' to preserve characters entities from source file (diff)
Add new option '-preserve' to preserve characters entities from source file
(i.e. leave them undecoded into plain characters). This feature will be utilized by translation teams and was successfuly tested against Russian and Japanese Translation Projects. Also add simple hack to not to display annoying "Can't open ~/.tidyrc" warning message in case if ~/.tidyrc file missing. Bump PORTREVISION. Approved by: Scott Kenney <saken@hotel.rmta.org> (maintainer) Tested by: myself, hrs
Notes
Notes: svn path=/head/; revision=50378
Diffstat (limited to 'www/tidy/files/patch-ac')
-rw-r--r--www/tidy/files/patch-ac43
1 files changed, 43 insertions, 0 deletions
diff --git a/www/tidy/files/patch-ac b/www/tidy/files/patch-ac
new file mode 100644
index 000000000000..957ffed0d981
--- /dev/null
+++ b/www/tidy/files/patch-ac
@@ -0,0 +1,43 @@
+--- config.c.orig Fri Aug 4 19:21:05 2000
++++ config.c Mon Nov 19 14:42:14 2001
+@@ -94,6 +94,7 @@
+ Bool TidyMark = yes; /* add meta element indicating tidied doc */
+ Bool Emacs = no; /* if true format error output for GNU Emacs */
+ Bool LiteralAttribs = no; /* if true attributes may use newlines */
++Bool PreserveEntities = no; /* if true don't convert entities to chars */
+
+ typedef struct _lex PLex;
+
+@@ -186,6 +187,7 @@
+ {"doctype", {(int *)&doctype_str}, ParseDocType},
+ {"fix-backslash", {(int *)&FixBackslash}, ParseBool},
+ {"gnu-emacs", {(int *)&Emacs}, ParseBool},
++ {"preserve-entities", {(int *)&PreserveEntities}, ParseBool},
+
+ /* this must be the final entry */
+ {0, 0, 0}
+@@ -423,7 +425,10 @@
+ /* open the file and parse its contents */
+
+ if ((fin = fopen(fname, "r")) == null)
+- FileError(stderr, fname);
++ {
++ if (FileExists(fname)) /* quiet file open error on */
++ FileError(stderr, fname); /* non-existent file */
++ }
+ else
+ {
+ config_text = null;
+@@ -533,6 +538,12 @@
+ {
+ QuoteAmpersand = yes;
+ HideEndTags = no;
++ }
++
++ /* Avoid &amp;copy; in preserve-entities case */
++ if (PreserveEntities)
++ {
++ QuoteAmpersand = no;
+ }
+ }
+