From d9a9e208f7374f155449b296e8002dc4619d3dc5 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 12 2013 14:28:22 +0000 Subject: Update centos-art.sh script's tuneup->xhtml module. - Previously, when building the anchor reference, it was used the entire heading line. So, each time you ran tuneup module, the anchor references were updated with a different hash value because the previous hash was also considered to build the new one. This make external references to pages transformed this way to fail. This commit uses only the heading content as reference and excludes everything else in the heading line. This makes external references pointing headings inside pages transformed through tuneup->xhtml module to always point the same heading location (considering the heading content has not changed since the last execution of tuneup-xhmlt module). --- diff --git a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh b/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh index 5b5a6cb..da458fd 100755 --- a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh +++ b/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh @@ -91,12 +91,12 @@ function xhtml_setToc { fi # Define initial heading information. - FIRST[${COUNT}]=$(echo ${HEADING} | sed -r "s!\\\040! !g") - TITLE[${COUNT}]=$(echo ${FIRST[${COUNT}]} | sed -r "s!${PATTERN}!\4!") - MD5SM[${COUNT}]=$(echo "${FILE}${FIRST[${COUNT}]}" | md5sum | sed -r 's![[:space:]]+-$!!') - OPTNS[${COUNT}]=$(echo ${FIRST[${COUNT}]} | sed -r "s!${PATTERN}!\3!") - CLASS[${COUNT}]=$(echo ${FIRST[${COUNT}]} | sed -r "s!${PATTERN}!\2!") - LEVEL[${COUNT}]=$(echo ${FIRST[${COUNT}]} | sed -r "s!${PATTERN}!\1!") + FIRST[${COUNT}]=$(echo "${HEADING}" | sed -r "s!\\\040! !g") + TITLE[${COUNT}]=$(echo "${FIRST[${COUNT}]}" | sed -r "s!${PATTERN}!\4!") + MD5SM[${COUNT}]=$(echo "${TITLE[${COUNT}]}" | md5sum | sed -r 's![[:space:]]+-$!!') + OPTNS[${COUNT}]=$(echo "${FIRST[${COUNT}]}" | sed -r "s!${PATTERN}!\3!") + CLASS[${COUNT}]=$(echo "${FIRST[${COUNT}]}" | sed -r "s!${PATTERN}!\2!") + LEVEL[${COUNT}]=$(echo "${FIRST[${COUNT}]}" | sed -r "s!${PATTERN}!\1!") PARENT[${COUNT}]=${LEVEL[${PREVCOUNT}]} # Transform heading information using initial heading