Skip to content

List Formatting #1

Description

@jonXmack

I downloaded this script this morning and it is saving me SO much time. However there is an issue with how lists are generated.

return {"type": list_type, "children": children} needs to be updated to return {"listType": list_type, "type": "list", "children": children}.

Additionally I made a minor tweak so it simply returns the value to the clipboard rather than displaying it within the terminal

I added import subprocess at the top

And adjusted the final lines to

json_data = html_to_json(html_input)

print('JSON data copied to clipboard')
subprocess.run("pbcopy", text=True, input=json_data)

Finally, on macOS users will need to install BeautifulSoup with python -m pip install beautifulsoup4 --break-system-packages

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions