Doxygen filter for OmegaT don't process code block properly

Issue #644 new
Hiroshi Miura(Tokyo Northside) created an issue

When using Okapi filter for OmegaT (ver: 1.4-m33) with OmegaT(v4.1.2_2), I observed some doxygen file processed strange around code block.

https://github.com/miurahr/gdal_docs_ja/blob/master/source/gdal_tutorial.dox

Here is a example;

/* $Id$ */

/*!
\page gdal_tutorial GDAL API Tutorial

\section gdal_tutorial_open Opening the File

Before opening a GDAL supported raster datastore it is necessary to
register drivers.  There is a driver for each supported format.  Normally
this is acco...<snip>

In C++:
\code
#include "gdal_priv.h"
#include "cpl_conv.h" // for CPLMalloc()

int main()
{
    GDALDataset  *poDataset;

    GDALAllRegister();

    poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly );
    if( poDataset == NULL )
    {
    ...;
    }
\endcode

In C:
\code
#include "gdal.h"
#include "cpl_conv.h" /* for CPLMalloc() */

int main()
{
    GDALDatasetH  hDataset;

    GDALAllRegister();

    hDataset = GDALOpen( pszFilename, GA_ReadOnly );
    if( hDataset == NULL )
    {
    ...;
    }
\endcode

In Python:
\code
    from osgeo import gdal

    dataset = gdal.Open(filename, gdal.GA_ReadOnly)
    if not dataset:
        ...
\endcode

Note that if GDALOpen() returns NULL it means the open failed, and that
an ...

That only shows just before 'In C:' and following sentences are now shown.

Comments (4)

  1. Chase Tingley

    Looks like there is an issue with C-style block quotes. This line breaks the file:

    #include "cpl_conv.h" /* for CPLMalloc() */
    

    but if you change it to // for CPLMalloc() it keeps going until the next one it hits, which is here:

        adfGeoTransform[0] /* top left x */
    
  2. Chase Tingley

    Oh, it looks like this is happening because we don't handle nested comments correctly. The whole file is inside a /*...*/ block, which itself contains sample code with additional /*...*/ comments. The comment tokenizer reads from the start of the outer comment to the end of the inner one.

  3. Log in to comment