Commit 06fa855f authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 2.0.5

parent 57c981d8
......@@ -926,7 +926,15 @@ AC_OUTPUT () {
if echo "$__config_files" | grep -v librarian.sh >/dev/null; then
# write a librarian that works with static libraries
AC_PROG_LN_S
if AC_PROG_LN_S ; then
__dolink=$PROG_LN_S
elif AC_PROG ln; then
__dolink=$PROG_LN
elif AC_PROG cp; then
__dolink=$PROG_CP
else
__dolink=:
fi
AC_PROG ar
AC_PROG ranlib
AC_SUB LD_LIBRARY_PATH HERE
......@@ -945,7 +953,7 @@ case "\$ACTION" in
make) ${PROG_AR} crv \$LIBRARY.a "\$@"
${PROG_RANLIB} \$LIBRARY.a
rm -f \$LIBRARY
${PROG_LN_S} \$LIBRARY.a \$LIBRARY
${__dolink} \$LIBRARY.a \$LIBRARY
;;
files) echo "\${LIBRARY}.a"
;;
......@@ -1184,9 +1192,9 @@ AC_COMPILER_PIC () {
# and if it can writes a librarian that handles those libraries for us.
#
AC_CC_SHLIBS () {
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_CC || AC_FAIL "Need a C compiler to build shared libraries"
AC_PROG_LN_S || AC_FAIL "Need to be able to make symbolic links for shared libraries"
AC_PROG_INSTALL || AC_FAIL "Need an install program to install shared libraries"
LOGN "checking whether the C compiler can build shared libraries "
echo "int some_variable = 0;" > /tmp/ngc$$.c
......
......@@ -571,7 +571,7 @@ linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
{
linkytype *tag;
if ( image )
if ( image || (ref == 0) )
tag = &imaget;
else if ( tag = pseudo(ref->link) ) {
if ( f->flags & (MKD_NO_EXT|MKD_SAFELINK) )
......@@ -667,7 +667,7 @@ linkylinky(int image, MMIOT *f)
sizeof key, (stfu)__mkd_footsort) )
status = linkyformat(f, name, image, ref);
else if ( f->flags & IS_LABEL )
status = linkyformat(f, name, image, &imaget);
status = linkyformat(f, name, image, 0);
}
}
}
......@@ -1312,13 +1312,12 @@ text(MMIOT *f)
static void
printheader(Paragraph *pp, MMIOT *f)
{
Qprintf(f, "<h%d", pp->hnumber);
if ( f->flags & MKD_TOC ) {
Qprintf(f, " id=\"", pp->hnumber);
Qstring("<a name=\"", f);
mkd_string_to_anchor(T(pp->text->text), S(pp->text->text), Qchar, f, 1);
Qchar('"', f);
Qstring("\"></a>\n", f);
}
Qchar('>', f);
Qprintf(f, "<h%d>", pp->hnumber);
push(T(pp->text->text), S(pp->text->text), f);
text(f);
Qprintf(f, "</h%d>", pp->hnumber);
......
......@@ -669,25 +669,29 @@ szmarkerclass(char *p)
* check if the first line of a quoted block is the special div-not-quote
* marker %[kind:]name%
*/
#define iscsschar(c) (isalpha(c) || (c == '-') || (c == '_') )
static int
isdivmarker(Line *p, int start, DWORD flags)
{
char *s;
int len, i;
int last, i;
if ( flags & (MKD_NODIVQUOTE|MKD_STRICT) )
return 0;
len = S(p->text);
s = T(p->text);
last= S(p->text) - (1 + start);
s = T(p->text) + start;
if ( !(len && s[start] == '%' && s[len-1] == '%') ) return 0;
if ( (last <= 0) || (*s != '%') || (s[last] != '%') )
return 0;
i = szmarkerclass(s+start+1)+start;
len -= start+1;
i = szmarkerclass(s+1);
while ( ++i < len )
if ( !isalnum(s[i]) )
if ( !iscsschar(s[i+1]) )
return 0;
while ( ++i < last )
if ( !(isdigit(s[i]) || iscsschar(s[i])) )
return 0;
return 1;
......
......@@ -41,5 +41,9 @@ more' \
<div class="more"><p>more</p></div>'
try '%class% with _' '>%class:this_that%' '<div class="this_that"></div>'
try '%class% with -' '>%class:this-that%' '<div class="this-that"></div>'
try 'illegal %class%' '>%class:0zip%' '<blockquote><p>%class:0zip%</p></blockquote>'
summary $0
exit $rc
......@@ -11,7 +11,8 @@ hi' \
'<ul>
<li><a href="#H1">H1</a></li>
</ul>
<h1 id="H1">H1</h1>
<a name="H1"></a>
<h1>H1</h1>
<p>hi</p>'
......@@ -22,14 +23,16 @@ try '-T -ftoc' 'toc item with link' \
<li><a href="#H2.here">H2 here</a></li>
</ul></li>
</ul>
<h2 id="H2.here"><a href="H2">H2</a> here</h2>'
<a name="H2.here"></a>
<h2><a href="H2">H2</a> here</h2>'
try '-T -ftoc' 'toc item with non-alpha start' \
'#1 header' \
'<ul>
<li><a href="#L1.header">1 header</a></li>
</ul>
<h1 id="L1.header">1 header</h1>'
<a name="L1.header"></a>
<h1>1 header</h1>'
summary $0
exit $rc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment