Comments (6)
Mediawiki format is similar but not the same as Markdown, so I don't think I would expect that to work. Why are you not uploading the original markdown using md2cf?
from md2cf.
Because it throws the same error as i described in the issue.
b'{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"Error parsing xhtml: Unexpected character
'>' (code 62) expected '='\n at : [11,26]","reason":"Bad Request"}'
Is there a way to read the xthml file it generates during the process?
from md2cf.
This sounds a bit like the problem I had in #81 - I wonder if you have some image alt text with an angle bracket or quote mark in it, which seems to cause the MD->HTML conversion lib Mistune to produce broken XHTML.
You get more debug information if you add the --debug
flag to md2cf.
If you want to see what's in the HTML when it's breaking, you might want to add
import pdb; pdb.set_trace()
to after line 440 (after where it says except HTTPError as e:
) and have a poke around in the page
object.
You also might like to try my branch that has an updated version of Mistune https://github.com/alphagov/md2cf/tree/upgrade-mistune.
from md2cf.
Thanks for the swift response. I tried your branch but I get the same error and i tried using debug and pasting the response below. Can you point out exactly where I can put the debugger trace?
`─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/main.py:402 in main │
│ │
│ [Errno 20] Not a directory: │
│ '/usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/main.py' │
│ │
│ /usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/upsert.py:93 in upsert_page │
│ │
│ [Errno 20] Not a directory: │
│ '/usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/upsert.py' │
│ │
│ /usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py:176 in create_page │
│ │
│ [Errno 20] Not a directory: │
│ '/usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py' │
│ │
│ /usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py:73 in _post │
│ │
│ [Errno 20] Not a directory: │
│ '/usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py' │
│ │
│ /usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py:66 in _request │
│ │
│ [Errno 20] Not a directory: │
│ '/usr/local/lib/python3.7/site-packages/md2cf-2.1.0-py3.7.egg/md2cf/api.py' │
│ │
│ /usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/models.py:1021 in │
│ raise_for_status │
│ │
│ 1018 │ │ │ ) │
│ 1019 │ │ │
│ 1020 │ │ if http_error_msg: │
│ ❱ 1021 │ │ │ raise HTTPError(http_error_msg, response=self) │
│ 1022 │ │
│ 1023 │ def close(self): │
│ 1024 │ │ """Releases the connection back to the pool. Once this method has been │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ http_error_msg = '400 Client Error: for url: │ │
│ │ https://oneconfluence.verizon.com/rest/api/content' │ │
│ │ reason = '' │ │
│ │ self = <Response [400]> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
HTTPError: 400 Client Error: for url: https://oneconfluence.verizon.com/rest/api/content
📄️ deploy_openstack ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ Error while uploading
Total progress ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
400 Client Error: for url: https://oneconfluence.verizon.com/rest/api/content -
b'{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"Error parsing xhtml: Unexpected character
'>' (code 62) expected '='\n at : [11,26]","reason":"Bad Request"}'`
from md2cf.
Heh, I forgot to give you the file name didn't I, it's md2cf/main.py
where the error is usually caught, and where you have a page
object that you can look at.
from md2cf.
Upon debugging, found out the issue was with the character '>'. Seems the tool wasn't able to differentiate it as xhtml also has similar characters. Thank you for your inputs.
Maybe this is something that can be fixed in the mistune. You can close the issue and consider it resolved. Thanks once again!
from md2cf.
Related Issues (20)
- mermaid diagrams support HOT 6
- .pages file at top (root) level HOT 2
- Link parsing fails for document references HOT 1
- PyYaml 6.0 failing with cython 3 update
- Title Checking is Case Sensitive but Confluence Page Uniqueness is Insensitive
- Skip Hidden Folders HOT 2
- Images displayed with a width of less than 400px HOT 2
- Image attachments don't work when using confluence.update_page() HOT 1
- Emoji does not get rendered when it is in line with a bullet
- 500 Server Error: Internal Server Error for url HOT 1
- Support for Obsidian Wikilinks
- `AttributeError` when adding new tags to an existing page HOT 1
- any chance for --only-changed to be compatible with --enable-relative-links ?
- Capability to upload files (pdf, docs...)
- Ignore the pages on upload
- writing page id in the md file
- Inline HTML not supporting
- Add support for adding a prefix to a title to avoid title conflicts
- dependencies are too tight specified
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 md2cf.