Comment 5 for bug 1060784

Revision history for this message
Yves Piguet (yves-piguet) wrote :

I think the following code, to be inserted in NME.c at line 2083, should implement what I've described above.

 else
 {
  // no separate link text or image alt text: write link verbatim
  for (k = 0; k < context->linkLength; )
  {
   if (outputFormat->charHookFun)
    CheckError(outputFormat->charHookFun(context->linkOffset + k,
      context,
      outputFormat->charHookData));
   if (outputFormat->encodeCharFun)
    CheckError(outputFormat->encodeCharFun(context->src + context->linkOffset,
      context->linkLength, &k,
      context,
      outputFormat->encodeCharData));
   else
   {
    context->dest[context->destLen++] = context->src[context->linkOffset + k];
    if (isFirstUTF8Byte(context->src[context->linkOffset + k]))
     context->destLenUCS16++;
    k++;
    context->col++;
   }
   CheckError(checkWordwrap(context, outputFormat));
  }
  // skip to end of link, before the end markup
  context->srcIndex = j;
 }