Skip to content

--links flag breaks tables #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FaFre opened this issue Mar 19, 2025 · 0 comments
Open

--links flag breaks tables #794

FaFre opened this issue Mar 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@FaFre
Copy link

FaFre commented Mar 19, 2025

Given the following Wikipedia data table (https://de.wikipedia.org/wiki/Stuttgart):

<tr>
<th>Wappen
</th>
<th>Deutschlandkarte
</th></tr>
<tr class="hintergrundfarbe-basis" style="height: 176px; text-align: center;">
<td style="width: 50%;"><span typeof="mw:File/Frameless"><a href="/wiki/Datei:DEU_Stuttgart_COA.svg" class="mw-file-description" title="Wappen der Stadt Stuttgart"><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3c/DEU_Stuttgart_COA.svg/140px-DEU_Stuttgart_COA.svg.png" decoding="async" width="140" height="145" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3c/DEU_Stuttgart_COA.svg/210px-DEU_Stuttgart_COA.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3c/DEU_Stuttgart_COA.svg/280px-DEU_Stuttgart_COA.svg.png 2x" data-file-width="526" data-file-height="545"></a></span>
</td>
<td style="width: 50%;">
<table cellspacing="0" cellpadding="0" class="" style="margin: 0 auto; border: 0; border-collapse: collapse; empty-cells: show;">
<tbody><tr>
<td><div class="noviewer" style="position: relative;"><div style="font-size: 5px; line-height: 0; position: absolute; display: block; left: 36.827777777778%; left: calc(36.827777777778% - 5px / 2); top: 80.05625879043%; top: calc(80.05625879043% - 5px / 2); padding: 0;"><span class="noviewer notpageimage" typeof="mw:File"><a href="/wiki/Datei:Reddot.svg" class="mw-file-description" title="Stuttgart"><img alt="Stuttgart" src="//upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Reddot.svg/5px-Reddot.svg.png" decoding="async" width="5" height="5" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Reddot.svg/8px-Reddot.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Reddot.svg/10px-Reddot.svg.png 2x" data-file-width="402" data-file-height="402"></a></span></div><span class="noviewer notpageimage" typeof="mw:File"><a href="/wiki/Datei:Germany_adm_location_map.svg" class="mw-file-description" title="Deutschlandkarte, Position der Stadt Stuttgart hervorgehoben"><img alt="Deutschlandkarte, Position der Stadt Stuttgart hervorgehoben" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Germany_adm_location_map.svg/250px-Germany_adm_location_map.svg.png" decoding="async" width="140" height="166" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Germany_adm_location_map.svg/330px-Germany_adm_location_map.svg.png 2x" data-file-width="1073" data-file-height="1272"></a></span></div>
</td></tr></tbody></table>
</td></tr>
<tr>
<th colspan="2">Basisdaten
</th></tr>
<tr class="hintergrundfarbe-basis">
<td><a href="/wiki/Geographische_Koordinaten" title="Geographische Koordinaten">Koordinaten</a>:
</td>
<td><span id="text_coordinates" class="coordinates plainlinks-print"><span style="white-space: nowrap;"><span style="color: blue; padding: 0px 3px 0px 0px; cursor: pointer;" class="wmamapbutton noprint" title="Ort auf interaktiver Karte anzeigen" alt=""></span><a class="external text" href="https://geohack.toolforge.org/geohack.php?pagename=Stuttgart&amp;language=de&amp;params=48.775555555556_N_9.1827777777778_E_region:DE-BW_type:city(613111)" style="white-space: normal;"><span title="Breitengrad">48°&nbsp;47′&nbsp;<abbr title="Nord">N</abbr></span>, <span title="Längengrad">9°&nbsp;11′&nbsp;<abbr title="Ost">O</abbr></span></a></span></span><span class="geo noexcerpt" style="display:none"><span class="body"></span><span class="latitude">48.775555555556</span><span class="longitude">9.1827777777778</span><span class="elevation">247</span></span><span id="coordinates" class="coordinates noprint"><span title="Koordinatensystem WGS84">Koordinaten: </span><a class="external text" href="https://geohack.toolforge.org/geohack.php?pagename=Stuttgart&amp;language=de&amp;params=48.775555555556_N_9.1827777777778_E_region:DE-BW_type:city(613111)"><span title="Breitengrad">48°&nbsp;47′&nbsp;<abbr title="Nord">N</abbr></span>, <span title="Längengrad">9°&nbsp;11′&nbsp;<abbr title="Ost">O</abbr></span></a><span class="noprint coordinates-separator"> | </span><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/55/WMA_button2b.png/17px-WMA_button2b.png" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/55/WMA_button2b.png/17px-WMA_button2b.png 1x, //upload.wikimedia.org/wikipedia/commons/thumb/5/55/WMA_button2b.png/34px-WMA_button2b.png 2x" class="wmamapbutton noprint" title="Ort auf interaktiver Karte anzeigen" alt="" style="padding: 0px 3px 0px 0px; cursor: pointer;"> | <a id="coordinates_map" href="#"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Openstreetmap_logo.svg/17px-Openstreetmap_logo.svg.png" width="17px" height="17px" alt="OSM"></a></span>
</td></tr>
<tr class="hintergrundfarbe-basis">
<td><a href="/wiki/Land_(Deutschland)" title="Land (Deutschland)">Bundesland</a>:</td>
<td><a href="/wiki/Baden-W%C3%BCrttemberg" title="Baden-Württemberg">Baden-Württemberg</a>
</td></tr>
<tr class="hintergrundfarbe-basis">
<td><a href="/wiki/Regierungsbezirk" title="Regierungsbezirk">Regierungsbezirk</a>:
</td>
<td><a href="/wiki/Regierungsbezirk_Stuttgart" title="Regierungsbezirk Stuttgart">Stuttgart</a>
</td></tr>

Running with --links will loose the table:

 | Wappen | Deutschlandkarte | |
 |---|---|---|
 |
-| ||
-| Basisdaten | ||
-| Koordinaten: | 48° 47′ N, 9° 11′ O | |
-| Bundesland: | Baden-Württemberg | |
-| Regierungsbezirk: | Stuttgart | |
-| Höhe: | 247 m ü. NHN | |
-| Fläche: | 207,32 km2
-| |
-| Einwohner: | 613.111 (31. Dez. 2023)[1]
-| |
-| Bevölkerungsdichte: | 2957 Einwohner je km2
-| |
-| Postleitzahlen: | 70173–70619 | |
-| Vorwahl: | 0711 | |
-| Kfz-Kennzeichen: | S | |
-| Gemeindeschlüssel: | 08 1 11 000 | |
-| LOCODE: | DE STR | |
-| NUTS: | DE111 | |
-| Stadtgliederung: | 23 Stadtbezirke, 152 Stadtteile | |
-| Adresse der Stadtverwaltung: |
-Marktplatz 1 70173 Stuttgart | |
-| Website: | www.stuttgart.de | |
-| Oberbürgermeister: | Frank Nopper[2] (CDU)
-| |
-| Lage der Stadt Stuttgart in Baden-Württemberg | ||
 
-**Stuttgart** (schwäbisch *Schduágórd*; um das Jahr 1160 *Stuokarten*;[3] ursprüngliche Bedeutung *Stutengarten*[4]) ist die Landeshauptstadt des Landes Baden-Württemberg und mit 613.111 Einwohnern (31. Dezember 2023) dessen bevölkerungsreichste Stadt. Die siebtgrößte Stadt Deutschlands gehört mit 2957 Einwohnern pro Quadratkilometer zu den am dichtesten bevölkerten Gemeinden Deutschlands. Die Stadt Stuttgart bildet das Zentrum der rund 2,8 Millionen Einwohner[5] zählenden Region Stuttgart, einem der größten Ballungsräume Deutschlands. Zudem ist sie Kernstadt der europäischen Metropolregion Stuttgart (etwa 5,5 Millionen Einwohner),[6] der fünftgrößten in Deutschland. Stuttgart hat den Status eines Stadtkreises und ist in 23 Stadtbezirke gegliedert. Als Sitz der Landesregierung und des Landtags sowie zahlreicher Landes- und einiger Bundesbehörden ist Stuttgart das politische Zentrum des Landes. Es ist Sitz des Regierungspräsidiums Stuttgart, das den gleichnamigen Regierungsbezirk verwaltet. In Stuttgart-Mitte tagt das Regionalparlament der Region Stuttgart, einer der drei Regionen im Regierungsbezirk Stuttgart. Darüber hinaus ist Stuttgart Sitz des evangelischen Landesbischofs von Württemberg und Teil der katholischen Diözese Rottenburg-Stuttgart. Die Stadt ist ein wichtiger Wirtschaftsstandort und Finanzplatz.
+[Koordinaten](https://de.wikipedia.org/wiki/Geographische_Koordinaten):[48° 47′ N, 9° 11′ O](https://geohack.toolforge.org/geohack.php?pagename=Stuttgart&language=de¶ms=48.775555555556_N_9.1827777777778_E_region:DE-BW_type:city(613111))[Bundesland](https://de.wikipedia.org/wiki/Land_(Deutschland)):[Baden-Württemberg](https://de.wikipedia.org/wiki/Baden-W%C3%BCrttemberg)[Regierungsbezirk](https://de.wikipedia.org/wiki/Regierungsbezirk):[Stuttgart](https://de.wikipedia.org/wiki/Regierungsbezirk_Stuttgart)[Höhe](https://de.wikipedia.org/wiki/H%C3%B6he_%C3%BCber_dem_Meeresspiegel):[NHN](https://de.wikipedia.org/wiki/Normalh%C3%B6hennull)[Fläche](https://de.wikipedia.org/wiki/Katasterfl%C3%A4che):2*(31. Dez. 2023)*[[1]](https://de.wikipedia.org#cite_note-Metadaten_Einwohnerzahl_DE-BW-1)[Bevölkerungsdichte](https://de.wikipedia.org/wiki/Bev%C3%B6lkerungsdichte):2[Postleitzahlen](https://de.wikipedia.org/wiki/Postleitzahl_(Deutschland)):[Vorwahl](https://de.wikipedia.org/wiki/Telefonvorwahl_(Deutschland)):[Kfz-Kennzeichen](https://de.wikipedia.org/wiki/Kfz-Kennzeichen_(Deutschland)):[Gemeindeschlüssel](https://de.wikipedia.org/wiki/Amtlicher_Gemeindeschl%C3%BCssel):[LOCODE](https://de.wikipedia.org/wiki/UN/LOCODE):[NUTS](https://de.wikipedia.org/wiki/NUTS):[23 Stadtbezirke, 152 Stadtteile](https://de.wikipedia.org/wiki/Liste_der_Stadtbezirke_und_Stadtteile_von_Stuttgart)Stadtverwaltung:
+
+[Marktplatz](https://de.wikipedia.org/wiki/Marktplatz_(Stuttgart))170173 Stuttgart
+
+[Website](https://de.wikipedia.org/wiki/Website):[www.stuttgart.de](https://www.stuttgart.de/)[Oberbürgermeister](https://de.wikipedia.org/wiki/Oberb%C3%BCrgermeister):[Frank Nopper](https://de.wikipedia.org/wiki/Frank_Nopper)([[2]](https://de.wikipedia.org#cite_note-Amtsverweser-2)[CDU](https://de.wikipedia.org/wiki/Christlich_Demokratische_Union_Deutschlands))**Stuttgart** ([schwäbisch](https://de.wikipedia.org/wiki/Schw%C3%A4bische_Dialekte) *Schduágórd*; um das Jahr 1160 *Stuokarten*; [3] ursprüngliche Bedeutung

Corresponding commands:

trafilatura -u "https://de.wikipedia.org/wiki/Stuttgart" --formatting --output-format markdown > out.md                                                                                        
trafilatura -u "https://de.wikipedia.org/wiki/Stuttgart" --formatting --links --output-format markdown > out.md
@adbar adbar added the bug Something isn't working label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants