John MacFarlane
d397a66107
MediaWiki reader: Tightened up template parsing.
...
The opening "{{" must be followed by an alphanumeric or ':'.
This prevents the exponential slowdown in #1033 .
Closes #1033 .
2014-06-20 12:00:26 -07:00
John MacFarlane
8f20ac3da3
MediaWiki reader: Support --trace.
2014-06-20 11:39:24 -07:00
Albert Krewinkel
8fdbef841d
Update copyright notices for 2014, add missing notices
2014-05-09 00:46:08 +02:00
John MacFarlane
ca40acea5b
MediaWiki reader: Handle table rows containing just an HTML comment.
...
Closes #1230 .
2014-04-10 16:52:30 -07:00
John MacFarlane
4ee92dce0c
MediaWiki reader: Fixed bug in certain nested lists.
...
The bug: If a level 2 list was followed by a level 1 list, the first
item of the level 1 list would be lost.
Closes #1213 .
2014-04-01 10:36:23 -07:00
John MacFarlane
6992050161
Parsing: Added HasMacros, simplified other typeclasses.
...
Removed updateHeaderMap, setHeaderMap, getHeaderMap,
updateIdentifierList, setIdentifierList, getIdentifierList.
2014-03-25 14:55:18 -07:00
John MacFarlane
08d1404b31
API changes to HasReaderOptions, HasHeaderMap, HasIdentifierList.
...
Previously these were typeclasses of monads. They've been changed
to be typeclasses of states. This ismplifies the instance definitions
and provides more flexibility.
This is an API change! However, it should be backwards compatible
unless you're defining instances of HasReaderOptions, HasHeaderMap,
or HasIdentifierList. The old getOption function should work as
before (albeit with a more general type).
The function askReaderOption has been removed.
extractReaderOptions has been added.
getOption has been given a default definition.
In HasHeaderMap, extractHeaderMap and updateHeaderMap have been added.
Default definitions have been given for getHeaderMap, putHeaderMap,
and modifyHeaderMap.
In HasIdentifierList, extractIdentifierList and updateIdentifierList
have been added. Default definitions have been given for
getIdentifierList, putIdentifierList, and modifyIdentifierList.
The ultimate goal here is to allow different parsers to use their
own, tailored parser states (instead of ParserState) while still
using shared functions.
2014-03-25 13:43:34 -07:00
John MacFarlane
b9cc29e15a
Merge pull request #1068 from jaimeMF/mw-images-langs
...
MediaWiki reader: Accept image links in more languages
2014-03-24 10:39:49 -07:00
John MacFarlane
9f3b2f6f5d
Fixed mediawiki ordered list parsing.
...
Closes #1122 .
2014-01-22 22:07:13 -08:00
Henry de Valence
3d70059a48
HLint: use fromMaybe
...
Replace uses of `maybe x id` with `fromMaybe x`.
2013-12-19 21:07:09 -05:00
Jaime Marquínez Ferrándiz
303e42a94f
MediaWiki reader: Accept image links in more languages
...
In some of the Wikipedia versions the local version of 'File' is used (for example 'Archivo' in Spanish)
2013-11-24 15:28:57 +01:00
John MacFarlane
0fd2176e29
MediaWiki reader: Add automatic header identifiers.
2013-11-17 08:47:14 -08:00
John MacFarlane
e5feed00f7
MediaWiki reader: Trim contents of <math>
tags.
...
Otherwise we get problems when converting to markdown.
Closes #1027 .
2013-10-18 17:50:43 -07:00
John MacFarlane
71841de0f3
Mediawiki: Parse an image + caption in a para by itself as a figure.
2013-09-11 09:31:41 -07:00
John MacFarlane
2c13b6f6dc
MedaWiki reader: Implement some mathjax extensions.
...
* `:<math>` for display math
* `\(..\)` for inline math
* `\[..\]` for display math
We omit the `$` forms as the heuristics are harder.
2013-09-07 22:43:56 -07:00
John MacFarlane
728e47ae15
MediaWiki reader: Allow Image: for images.
...
Closes #971 .
2013-09-06 15:40:08 -07:00
John MacFarlane
02a125d0aa
Use walk, walkM in place of bottomUp, bottomUpM when possible.
...
They are significantly faster.
2013-08-10 18:45:00 -07:00
John MacFarlane
ca09c1ac3b
MediaWiki reader: Ignore attributes on headers.
2013-05-20 11:08:27 -07:00
John MacFarlane
c63e490ab2
MediaWiki reader: Skip attributes on table rows.
...
Previously we just crashed if rows had attributes, now we
ignore them.
2013-05-20 10:43:12 -07:00
John MacFarlane
e81b87c2dc
Mediawiki reader: Fixed | links inside table cells.
...
Improved attribute parsing.
2013-03-28 11:26:22 -07:00
John MacFarlane
998695001a
Mediawiki reader: Fixed last commit.
2013-03-28 10:51:14 -07:00
John MacFarlane
48b23d491d
MediaWiki reader: Correctly handle indented preformatted text
...
without preceding or following blank line.
2013-03-28 10:48:00 -07:00
John MacFarlane
351b3e09c3
mediawiki reader: allow space before table rows.
2013-03-27 08:45:51 -07:00
Jeff Runningen
efddb85d46
Mediawiki reader: Don't require blanklines after tables.
2013-01-27 23:15:46 -05:00
John MacFarlane
71c5ebe682
Use anyLine everywhere instead of 'manyTill anyChar newline'.
2013-01-25 18:32:15 -08:00
John MacFarlane
300f8528da
Mediawiki reader: interpret HTML in verbatim contexts as text.
...
Thanks to Jeff Runningen for reporting that mediawiki works
this way.
2013-01-06 19:35:40 -08:00
John MacFarlane
fc31bf27f5
MediaWiki reader: Allow table in table cell.
2012-09-15 21:06:55 -07:00
John MacFarlane
3e8630c88e
MediaWiki reader: Added smart doublequotes with -S option.
...
Also disallow ' in the "trail" of an internal link; allowing
it causes bugs with `'''[[Link]]'''`.
2012-09-15 16:56:01 -04:00
John MacFarlane
0cd2289eea
MediaWiki parser: Improved endline to stop bad breaks.
2012-09-15 16:40:35 -04:00
John MacFarlane
bc29f44d59
MediaWiki reader: Allow def list item with just a term.
2012-09-15 16:25:51 -04:00
John MacFarlane
c9faa2740b
MediaWiki reader: Properly handle templates in list items.
2012-09-15 16:17:52 -04:00
John MacFarlane
c5de3c411f
MediaWiki reader: Handle ref tags as footnotes.
2012-09-15 15:33:48 -04:00
John MacFarlane
293452f970
MediaWiki reader: Better parsing of templates.
2012-09-15 15:22:18 -04:00
John MacFarlane
387308dc47
MediaWiki reader: Treat "references" tag as block.
2012-09-15 15:05:50 -04:00
John MacFarlane
0a2fb202fb
MediaWiki reader: Interpret width attribute on table columns.
2012-09-15 15:04:11 -04:00
John MacFarlane
26fb63e294
MediaWiki reader: Got alignments working.
...
They only work on headers, because pandoc forces same
alignment for all cells in a column.
2012-09-15 14:20:50 -04:00
John MacFarlane
eca9eeab6b
MediaWiki reader: Misc fixes, put category links at end.
2012-09-15 13:50:02 -04:00
John MacFarlane
bc5fe70d15
MediaWiki reader: Skip inline templates, handle <source>.
2012-09-15 01:47:57 -04:00
John MacFarlane
a2391b0395
MediaWiki reader: Parse styles on table cells.
2012-09-15 01:13:26 -04:00
John MacFarlane
9a54a949c7
MediaWiki reader: Parse styles after '{|' table start.
2012-09-15 00:23:24 -04:00
John MacFarlane
aa476b42cb
MediaWiki reader: || between table cells.
2012-09-14 23:51:43 -04:00
John MacFarlane
28d2cf9500
MediaWiki reader: Improved table parsing.
2012-09-14 23:29:06 -04:00
John MacFarlane
ce509be57a
MediaWiki reader: Table improvements, added simple table tests.
2012-09-14 10:55:16 -04:00
John MacFarlane
6e9351bac4
MediaWiki reader: Support for basic mediawiki tables.
2012-09-14 10:19:35 -04:00
John MacFarlane
46be934994
MediaWiki reader: Images.
2012-09-13 18:16:25 -07:00
John MacFarlane
a0d7b3f37b
MediaWiki reader: internal links.
2012-09-13 17:06:09 -07:00
John MacFarlane
fc2f7a4942
MediaWiki reader: Implemented basic internal links.
...
Including word-ending links and the "pipe trick."
2012-09-13 16:55:08 -07:00
John MacFarlane
017095f690
MediaWiki reader: Implemented numbered external links.
2012-09-13 15:24:05 -07:00
John MacFarlane
8cc5625bd6
MediaWiki reader: Use MWState instead of ParserState.
2012-09-13 15:10:40 -07:00
John MacFarlane
5b29f0f598
MediaWiki reader: Ignore <gallery>
tags.
2012-09-13 14:55:33 -07:00