Skip to content
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

Support for multi paragraph itemize / crash with --match=strict #67

Open
nthiery opened this issue Dec 12, 2017 · 0 comments
Open

Support for multi paragraph itemize / crash with --match=strict #67

nthiery opened this issue Dec 12, 2017 · 0 comments

Comments

@nthiery
Copy link

nthiery commented Dec 12, 2017

With the following example, the second paragraph "Contrairement ..." gets interpreted by notedown as a code block instead of a second paragraph of the first item:

1.  Donner un exemple de drapeau infini décroissant; c'est-à-dire une suite infinie ... de sous-modules strictement emboîtés.

    Contrairement aux espaces vectoriels, deux sous-modules emboîtés de même dimension ne sont pas forcément égaux.

2.  Existe-t'il des drapeaux croissants infinis?

Since all my code blocks are fenced, I tried to work around this issue using match=strict, but this led to a crash:

mistral-/tmp>notedown --match=strict algebre_lineaire_anneaux.md >! algebre_lineaire_anneaux.ipynb
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.6/site-packages/nbformat/validator.py", line 256, in validate
    return validator.validate(nbjson, {'$ref' : '#/definitions/%s' % ref})
  File "/opt/miniconda3/lib/python3.6/site-packages/jsonschema/validators.py", line 130, in validate
    raise error
jsonschema.exceptions.ValidationError: None is not valid under any of the given schemas

Failed validating 'oneOf' in schema['properties']['source']:
    {'oneOf': [{'type': 'string'},
               {'items': {'type': 'string'}, 'type': 'array'}]}

On instance['source']:
    None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/miniconda3/bin/notedown", line 11, in <module>
    sys.exit(app())
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/main.py", line 312, in app
    main(args, help=parser.format_help())
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/main.py", line 275, in main
    notebook = reader.read(ip, as_version=4)
  File "/opt/miniconda3/lib/python3.6/site-packages/nbformat/v4/rwbase.py", line 114, in read
    return self.reads(nbs, **kwargs)
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/notedown.py", line 376, in reads
    return self.to_notebook(s, **kwargs)
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/notedown.py", line 368, in to_notebook
    cells = self.create_cells(blocks)
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/notedown.py", line 347, in create_cells
    markdown_cell = self.create_markdown_cell(block)
  File "/opt/miniconda3/lib/python3.6/site-packages/notedown/notedown.py", line 323, in create_markdown_cell
    markdown_cell = nbbase.new_markdown_cell(**kwargs)
  File "/opt/miniconda3/lib/python3.6/site-packages/nbformat/v4/nbbase.py", line 112, in new_markdown_cell
    validate(cell, 'markdown_cell')
  File "/opt/miniconda3/lib/python3.6/site-packages/nbformat/v4/nbbase.py", line 23, in validate
    return validate(node, ref=ref, version=nbformat)
  File "/opt/miniconda3/lib/python3.6/site-packages/nbformat/validator.py", line 260, in validate
    raise better_validation_error(e, version, version_minor)
nbformat.validator.NotebookValidationError: None is not valid under any of the given schemas

Failed validating 'oneOf' in notebook['properties']['source']:

On instance['source']:
None

Thanks!

edschofield added a commit to PythonCharmers/notedown that referenced this issue Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant