kerchen / kerchen/export_gr2evernote

About the character `&` in the url

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
64
Forks
10
PR merge metrics
No merged PRs in 30d

Description

It seems that `export2enex.py` doesn't escape `&` correctly in the `source-url` property of each entry, which results in an import error of the `enex` file says

```
UNEXPECTED_CHAR(Error in line 122, token "'==' -- "id"")
```

I used xml syntax to highlight the `enex` file and discoverd that `&` is highlighted in red unlike other characters in the url. Anyway, I added a small code snippet right before the string `msg_url` inserted into `msg_body` as follows:

``` .python
if '&' in msg_url:
msg_url=msg_url.replace('&', '&')
```

I'm still learning python, I don't know if this is the appropriate way to fix the `bug`,but it works for me, so here i am.

BTW, excellent work for this python script, helps a lot!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in export2enex.py at the msg_url insertion into msg_body and inspect how source-url values are escaped for the ENEX/XML output. Reproduce the import error with a URL containing '&' and verify that the exported ENEX file parses successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.