Add a workaround to prevent Tidy from converting tabs to spaces
by converting them to 	 before Tidy gets them. Then Tidy converts them back to real tabs, not spaces. Reviewed by: hrs, gjb
This commit is contained in:
parent
d59c6a518d
commit
747f2d46e6
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=38341
4 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,9 @@ AWK?= /usr/bin/awk
|
||||||
GREP?= /usr/bin/grep
|
GREP?= /usr/bin/grep
|
||||||
REALPATH?= /bin/realpath
|
REALPATH?= /bin/realpath
|
||||||
SED?= /usr/bin/sed
|
SED?= /usr/bin/sed
|
||||||
|
# a hack to keep tidy from converting tabs to spaces
|
||||||
|
# replace them with 	 before calling tidy
|
||||||
|
REINPLACE_TABS_CMD?= ${SED} -i -e 's/ /\&\#09;/g'
|
||||||
|
|
||||||
.if defined(DOC_PREFIX) && !empty(DOC_PREFIX)
|
.if defined(DOC_PREFIX) && !empty(DOC_PREFIX)
|
||||||
WEB_PREFIX?= ${DOC_PREFIX}/../www
|
WEB_PREFIX?= ${DOC_PREFIX}/../www
|
||||||
|
|
|
@ -525,6 +525,7 @@ index.html: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
||||||
${DOC}.xml
|
${DOC}.xml
|
||||||
.endif
|
.endif
|
||||||
.if !defined(NO_TIDY)
|
.if !defined(NO_TIDY)
|
||||||
|
${REINPLACE_TABS_CMD} $$(${XARGS} < HTML.manifest)
|
||||||
-${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
|
-${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -545,6 +546,7 @@ ${DOC}.html: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
||||||
${DOC}.xml > ${.TARGET}
|
${DOC}.xml > ${.TARGET}
|
||||||
.endif
|
.endif
|
||||||
.if !defined(NO_TIDY)
|
.if !defined(NO_TIDY)
|
||||||
|
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,7 @@ all: ${_docs}
|
||||||
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
||||||
${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET}
|
${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET}
|
||||||
.if !defined(NO_TIDY)
|
.if !defined(NO_TIDY)
|
||||||
|
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
|
@ -385,6 +385,7 @@ ${TARGET.${_ID}}: ${XML.${_ID}} ${DEPENDS.${_ID}}
|
||||||
${XSLT.${_ID}} ${XML.${_ID}}
|
${XSLT.${_ID}} ${XML.${_ID}}
|
||||||
. if !defined(NO_TIDY) || empty(NO_TIDY)
|
. if !defined(NO_TIDY) || empty(NO_TIDY)
|
||||||
. if !defined(NO_TIDY.${_ID}) || empty(NO_TIDY.${_ID})
|
. if !defined(NO_TIDY.${_ID}) || empty(NO_TIDY.${_ID})
|
||||||
|
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||||
. endif
|
. endif
|
||||||
. endif
|
. endif
|
||||||
|
|
Loading…
Reference in a new issue