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
|
||||
REALPATH?= /bin/realpath
|
||||
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)
|
||||
WEB_PREFIX?= ${DOC_PREFIX}/../www
|
||||
|
|
|
@ -525,6 +525,7 @@ index.html: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
|||
${DOC}.xml
|
||||
.endif
|
||||
.if !defined(NO_TIDY)
|
||||
${REINPLACE_TABS_CMD} $$(${XARGS} < HTML.manifest)
|
||||
-${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
|
||||
.endif
|
||||
|
||||
|
@ -545,6 +546,7 @@ ${DOC}.html: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
|||
${DOC}.xml > ${.TARGET}
|
||||
.endif
|
||||
.if !defined(NO_TIDY)
|
||||
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||
.endif
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ all: ${_docs}
|
|||
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
||||
${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET}
|
||||
.if !defined(NO_TIDY)
|
||||
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||
.endif
|
||||
|
||||
|
|
|
@ -385,6 +385,7 @@ ${TARGET.${_ID}}: ${XML.${_ID}} ${DEPENDS.${_ID}}
|
|||
${XSLT.${_ID}} ${XML.${_ID}}
|
||||
. if !defined(NO_TIDY) || empty(NO_TIDY)
|
||||
. if !defined(NO_TIDY.${_ID}) || empty(NO_TIDY.${_ID})
|
||||
${REINPLACE_TABS_CMD} ${.TARGET}
|
||||
-${TIDY} ${TIDYOPTS} ${.TARGET}
|
||||
. endif
|
||||
. endif
|
||||
|
|
Loading…
Reference in a new issue