|
10 | 10 |
|
11 | 11 | // comment this out to disable in-page footnotes |
12 | 12 | #define DOCX_CRENGINE_IN_PAGE_FOOTNOTES 1 |
| 13 | +// build FB2 DOM, comment out to build HTML DOM |
| 14 | +#define DOCX_FB2_DOM_STRUCTURE 1 |
13 | 15 |
|
14 | 16 | /// known docx items name and identifier |
15 | 17 | struct item_def_t { |
@@ -1413,7 +1415,7 @@ void docx_ElementHandler::generateLink(const lChar16 *target, const lChar16 *typ |
1413 | 1415 | #ifndef DOCX_CRENGINE_IN_PAGE_FOOTNOTES |
1414 | 1416 | if( !lStr_cmp(type, "note") ) { |
1415 | 1417 | // For footnotes (but not endnotes), wrap in <sup> (to get the |
1416 | | - // same effect upstream gets with the following in docx.css: |
| 1418 | + // same effect as the following in docx.css: |
1417 | 1419 | // a[type="note"] { vertical-align: super; font-size: 70%; } |
1418 | 1420 | m_writer->OnTagOpen(L"", L"sup"); |
1419 | 1421 | m_writer->OnTagBody(); |
@@ -1864,11 +1866,11 @@ const lChar16 *docx_pHandler::getStyleTagName(lChar16 ch) |
1864 | 1866 | case 'b': |
1865 | 1867 | return L"strong"; |
1866 | 1868 | case 'i': |
1867 | | - return L"em"; // upstream uses L"emphasis"; |
| 1869 | + return L"em"; |
1868 | 1870 | case 'u': |
1869 | 1871 | return L"u"; |
1870 | 1872 | case 's': |
1871 | | - return L"s"; // upstream uses L"strike"; |
| 1873 | + return L"s"; |
1872 | 1874 | case 't': |
1873 | 1875 | return L"sup"; |
1874 | 1876 | case 'd': |
@@ -2313,13 +2315,15 @@ bool ImportDocXDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallba |
2313 | 2315 | writer.OnTagClose(NULL, L"title-info"); |
2314 | 2316 | writer.OnTagClose(NULL, L"description"); |
2315 | 2317 |
|
| 2318 | +#ifdef DOCX_FB2_DOM_STRUCTURE |
2316 | 2319 | //Two options when dealing with titles: (FB2|HTML) |
2317 | 2320 | docx_fb2TitleHandler titleHandler(&writer, &importContext); //<section><title class=hx">..</title></section> |
2318 | | - //docx_titleHandler titleHandler(&writer, &importContext); //<hx>..</hx> |
| 2321 | +#else |
| 2322 | + docx_titleHandler titleHandler(&writer, &importContext); //<hx>..</hx> |
| 2323 | +#endif |
2319 | 2324 | docx_documentHandler documentHandler(&docReader, &writer, &importContext, &titleHandler); |
2320 | 2325 | docReader.setHandler(&documentHandler); |
2321 | 2326 |
|
2322 | | - |
2323 | 2327 | LVXMLParser parser(m_stream, &docReader); |
2324 | 2328 |
|
2325 | 2329 | if ( !parser.Parse() ) |
|
0 commit comments