Skip to content

Commit ceaa982

Browse files
authored
TIKA-4759 - use a markdown writer (#2900)
1 parent 6d6da7d commit ceaa982

8 files changed

Lines changed: 801 additions & 380 deletions

File tree

tika-app/src/main/appended-resources/META-INF/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,3 +900,32 @@ Sqlite (included in the "provided" org.xerial's sqlite-jdbc)
900900
Sqlite is in the Public Domain. For details
901901
see: https://www.sqlite.org/copyright.html
902902

903+
commonmark-java libraries (commonmark, commonmark-ext-gfm-tables, and
904+
commonmark-ext-gfm-strikethrough)
905+
906+
The BSD 2-Clause License
907+
908+
Copyright (c) 2015, Atlassian Pty Ltd
909+
All rights reserved.
910+
911+
Redistribution and use in source and binary forms, with or without
912+
modification, are permitted provided that the following conditions are met:
913+
914+
* Redistributions of source code must retain the above copyright notice, this
915+
list of conditions and the following disclaimer.
916+
917+
* Redistributions in binary form must reproduce the above copyright notice,
918+
this list of conditions and the following disclaimer in the documentation
919+
and/or other materials provided with the distribution.
920+
921+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
922+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
923+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
924+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
925+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
926+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
927+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
928+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
929+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
930+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
931+

tika-bundles/tika-bundle-standard/src/test/java/org/apache/tika/bundle/BundleIT.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,19 @@ static void startFramework() throws Exception {
8585
// Install all bundles first, then start.
8686
// tika-core requires osgi.serviceloader capabilities that are
8787
// provided by tika-bundle-standard, so both must be installed
88-
// before either can resolve.
88+
// before either can resolve. tika-core also imports the org.commonmark
89+
// packages (Markdown serialization), so those bundles must be present too.
8990
Bundle commonsIo = install("commons-io.jar");
91+
Bundle commonmark = install("commonmark.jar");
92+
Bundle commonmarkTables = install("commonmark-ext-gfm-tables.jar");
93+
Bundle commonmarkStrikethrough = install("commonmark-ext-gfm-strikethrough.jar");
9094
Bundle tikaCore = install("tika-core.jar");
9195
Bundle tikaBundle = install("tika-bundle-standard.jar");
9296

9397
commonsIo.start();
98+
commonmark.start();
99+
commonmarkTables.start();
100+
commonmarkStrikethrough.start();
94101
tikaCore.start();
95102
tikaBundle.start();
96103
}

tika-bundles/tika-bundle-standard/test-bundles.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<include>org.apache.tika:tika-core</include>
3131
<include>org.apache.tika:tika-bundle-standard</include>
3232
<include>commons-io:commons-io</include>
33+
<include>org.commonmark:commonmark</include>
34+
<include>org.commonmark:commonmark-ext-gfm-tables</include>
35+
<include>org.commonmark:commonmark-ext-gfm-strikethrough</include>
3336
</includes>
3437
</dependencySet>
3538
<dependencySet>

tika-core/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@
4444
<groupId>commons-io</groupId>
4545
<artifactId>commons-io</artifactId>
4646
</dependency>
47+
<!-- Markdown serialization (ToMarkdownContentHandler). BSD 2-Clause, ASF Category A,
48+
zero transitive dependencies. -->
49+
<dependency>
50+
<groupId>org.commonmark</groupId>
51+
<artifactId>commonmark</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.commonmark</groupId>
55+
<artifactId>commonmark-ext-gfm-tables</artifactId>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.commonmark</groupId>
59+
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>
60+
</dependency>
4761

4862
<!-- Optional OSGi dependencies, used only when running within OSGi -->
4963
<dependency>

0 commit comments

Comments
 (0)