timofurrer / pandoc-plantuml-filter

Pandoc filter for PlantUML code blocks
https://pypi.org/project/pandoc-plantuml-filter
MIT License
104 stars 26 forks source link

Fix case when symlink created in CWD #14

Closed Felixoid closed 3 years ago

Felixoid commented 4 years ago

This PR fixes error FileNotFoundError: [Errno 2] No such file or directory: '' when plantuml-filename doesn't contain directories

Felixoid commented 4 years ago

Hello, dear Timo @timofurrer, Could you please, consider these changes?

573 commented 3 years ago

Can this be merged ? I tested with patches' test/sample.md and see no problems.

NIX_PATH=nixpkgs=http://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz nix-shell --pure -p pandoc -p texlive.combined.scheme-small -p pandoc-plantuml-filter -p plantuml --run "pandoc sample.md -o sample.pdf --filter pandoc-plantuml"
# ~/.config/nixpkgs/overlays/pandoc-plantuml-filter.nix
self: super:
{
  pandoc-plantuml-filter = super.pandoc-plantuml-filter.overrideAttrs (old: {
    src = super.fetchFromGitHub {
      owner = "timofurrer";
      repo = "pandoc-plantuml-filter";
      rev = "master";
      sha256 = "0qh8n3a916xn6s8693ldxgah0rnjg7gyjf74j1vxqyll8gsnlgb1";
    };
    patches = (old.patches or []) ++ [
      (super.fetchpatch {
        url = "https://github.com/timofurrer/pandoc-plantuml-filter/commit/4634f3d808527b9223a216747a841619c63a8774.patch";
        sha256 = "0nzcrxvj0fw16p6ysp0yf55sg1jyn2y6dic66b8k3pzm93m58y48";
      })
      (super.fetchpatch {
        url = "https://github.com/timofurrer/pandoc-plantuml-filter/commit/5c8705fcb9b928c2a9f9d1f4dbbb716f2666da88.patch";
        sha256 = "0y0zc9di9dsr2n0iyimrayqcgi4p4spq1nwdb68iklz35f01z8lq";       
      })
    ];
  });
}