- **Removed legacy build files**:
- Deleted obsolete `.travis.yml`, `flake.lock`, and `flake.nix` files that were no longer needed for the current build and dependency management setup.
- **Updated versioning**:
- Incremented the package version from `0.4.0` to `0.5.0` in `version.py` and made adjustments in `pyproject.toml` to reflect the new versioning mechanism.
- **Refined package structure**:
- Moved source files from `src/python_markdown_oembed_extension` to `mdx_oembed` and renamed references accordingly for better clarity and organization of the codebase.
- **Enhanced OEmbed functionality**:
- Added dedicated endpoint handling in the new `endpoints.py`.
- Refactored the `oembed.py` file to implement a minimal oEmbed consumer, replacing the earlier dependency on `python-oembed`.
- **Improved test coverage**:
- Transitioned tests from `unittest` to `pytest` framework for better maintainability.
- Expanded unit tests, including better error handling and validation for various media types.
- **Updated dependency requirements**:
- Raised minimum Python version from `3.9` to `3.12` in `pyproject.toml`.
- Removed non-essential dependencies and restructured the dependency declarations to streamline package management.
These changes focus on modernizing the codebase, improving adherence to current Python standards, and enhancing overall functionality and maintainability.
- Merged improvements from Wenzil's fork. Thanks Wenzil!
- Update for new version of Markdown breaks backwards compatability.
- Dropped test support for Python 2.6
- Fixed test suite (including Travis CI config)
Before this change, only three hardcoded oEmbed endpoints were available
for users of the extension; youtube, flickr and vimeo. In the
configuration, it was only possible to pass a subset of those 3 oEmbed
endpoints. It was done by passing the names of the allowed endpoints.
With this change, the API has changed. The allowed_endpoints kwarg now
expects to be passed a list of OEmbedEndpoint objects (as opposed to
names). This means the responsibility of creating OEmbedEndpoint objects
has been shifted to the user of the extension. If the allowed_endpoints
kwarg is omitted, the default oEmbed endpoints used will be the same as
before; youtube, flickr and vimeo.
The motivation is to allow arbitrary oEmbed endpoints, without
necessitating anyone to maintain the list of all possible oEmbed
endpoints out there.
The reasoning is that the translation of Markdown into HTML should be as
concise as possible. The semantics of the figure element seem to fit the
embedded nature of OEmbed content moreso than the div element which is
quite generic.
To keep a constant aspect ratio for the resulting iframe of an oEmbed
request in a responsive website, the iframe needs a div wrapper. With
this change, html results are wrapped in a "oembed" class div.