Git Product home page Git Product logo

Comments (6)

galund avatar galund commented on July 23, 2024

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.

harish0619 avatar harish0619 commented on July 23, 2024

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.

galund avatar galund commented on July 23, 2024

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.

harish0619 avatar harish0619 commented on July 23, 2024

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.

galund avatar galund commented on July 23, 2024

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.

harish0619 avatar harish0619 commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.