Comments (3)
I did some experimentation, using .get('t')
in a few places seems to fix everything.
So:
diff --git a/codebraid/converters/pandoc.py b/codebraid/converters/pandoc.py
index 132a5f2..e03537c 100644
--- a/codebraid/converters/pandoc.py
+++ b/codebraid/converters/pandoc.py
@@ -510,7 +510,7 @@ def _get_walk_less_note_contents_closure(enumerate=enumerate, isinstance=isinsta
yield from walk_node_list_less_note_contents(obj)
elif isinstance(obj, dict):
yield (obj, node_list, index)
- if obj['t'] == 'Note':
+ if obj.get('t') == 'Note':
continue
obj_contents = obj.get('c', None)
if isinstance(obj_contents, list):
@@ -1004,7 +1004,7 @@ class PandocConverter(Converter):
'SoftBreak', 'Span'])
for node_tuple in self._walk_ast_less_note_contents(ast):
node, parent_node_list, parent_node_list_index = node_tuple
- node_type = node['t']
+ node_type = node.get('t')
if node_type in ignorable_inline_node_types:
pass
elif node_type == 'Str':
@@ -1212,7 +1212,7 @@ class PandocConverter(Converter):
thaw_raw_node = self._thaw_raw_node
for node_tuple in self._walk_ast(final_ast):
node, parent_node_list, parent_node_list_index = node_tuple
- node_type = node['t']
+ node_type = node.get('t')
if node_type in ('Code', 'CodeBlock') and 'codebraid--temp' in node['c'][0][1]:
thaw_raw_node(node)
else:
However, this is a blind replace on my part, simply replacing wherever it complained that it was broken, so I have no idea if this breaks anything else. Should I open a PR?
from codebraid.
It should be fixed in the last commit. Citations like that are represented in Pandoc's AST in a form that I hadn't previously encountered.
from codebraid.
Seems to fix it! Thank you for the quick turnaround :)
from codebraid.
Related Issues (20)
- Pandoc Version Read Incorrectly HOT 1
- Errors with pandoc 2.11 HOT 3
- Search path for Python executable on Windows
- --citeproc Pandoc option HOT 1
- Failure when specifying local MathJax HOT 2
- Use of inline html code characters appears to break source file parsing HOT 2
- Working with multiple source files w/ .cb.nb HOT 2
- can't run codebraid with new version of jupyter-client HOT 4
- What is the status of per-chunk caching? Is it supported/planned? HOT 8
- `codebraid` can't handle raw latex HOT 8
- Custom executable / custom language HOT 4
- How to use the Julia jupyter kernel to generate plots in output HOT 4
- Does codebraid work with Python Anaconda environments? Trouble plotting with python from jupyter notebook HOT 7
- Question about removing extraneous markdown characters from output HOT 2
- --only-code-output doesn't support example=true
- Overly aggressive caching HOT 3
- Markdown strings don't render normally HOT 2
- Feature request: Force execution of all code cells without adding `.cb-run` and `.cb-nb` HOT 3
- Feature request: override stdout code block language HOT 2
- host a website HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codebraid.