Skip to content

Commit 04d1e66

Browse files
docs/story-class.rst fitz/fitz.i: Removed Story.warnings(), as currently unsafe to use.
The underlying fz_story_warnings() fn invalidates the story's xml, so attempting afterwards to use the xml from python could cause a crash.
1 parent 06d1612 commit 04d1e66

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

docs/story-class.rst

-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Story
1414
:meth:`Story.reset` "rewind" story output to its beginning
1515
:meth:`Story.place` compute story content to fit in provided rectangle
1616
:meth:`Story.draw` write the computed content to current page
17-
:meth:`Story.warnings` read any warnings generated by HTML/CSS parsers
1817
:meth:`Story.element_positions` callback function logging currently processed story content
1918
:attr:`Story.body` the story's underlying :htmlTag:`body`
2019
:meth:`Story.write` places and draws Story to a DocumentWriter
@@ -88,14 +87,6 @@ Story
8887

8988
Rewind the story's document to the beginning for starting over its output.
9089

91-
.. method:: warnings()
92-
93-
An entirely optional method to check for any errors when parsing HTML / CSS source. Use this if the source quality is uncertain and / or may contain HTML / CSS language elements that are not (yet) supported by the parsers used by MuPDF. For example, MuPDF only supports CSS up to level 2, not the more advanced level 3.
94-
95-
.. caution:: This method will invalidate the :ref:`Story` object! The same story must be created again afterwards -- so the method should only be used if there is a high chance to encounter problematic sources.
96-
97-
:returns: a string with error messages generated by the source parsing.
98-
9990
.. attribute:: body
10091

10192
The :htmlTag:`body` part of the story's DOM. Even if `html=None` has been used at story creation, the following minimum HTML source will always be available::

fitz/fitz.i

-13
Original file line numberDiff line numberDiff line change
@@ -13582,19 +13582,6 @@ struct Story
1358213582
return (struct Xml*) dom;
1358313583
}
1358413584

13585-
FITZEXCEPTION(warnings, !result)
13586-
PyObject* warnings()
13587-
{
13588-
const char *text=NULL;
13589-
fz_try(gctx) {
13590-
text = fz_story_warnings(gctx, (fz_story *)$self);
13591-
}
13592-
fz_catch(gctx) {
13593-
return NULL;
13594-
}
13595-
return Py_BuildValue("s", text);
13596-
}
13597-
1359813585
FITZEXCEPTION(element_positions, !result)
1359913586
%pythonprepend element_positions %{
1360013587
if type(args) is dict:

0 commit comments

Comments
 (0)