Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 5 additions & 3 deletions htmltools/_core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pyright: reportMissingTypeStubs=false
import os
import posixpath
import shutil
import sys
import tempfile
Expand Down Expand Up @@ -1091,7 +1092,8 @@ def source_path_map(
href = self.name
if include_version:
href += "-" + str(self.version)
href = os.path.join(lib_prefix, href) if lib_prefix else href
if lib_prefix:
href = posixpath.join(lib_prefix, href)
return {"source": source, "href": href}

def as_html_tags(
Expand Down Expand Up @@ -1122,15 +1124,15 @@ def as_dict(
href = urllib.parse.quote(s["href"])
s.update(
{
"href": os.path.join(paths["href"], href),
"href": posixpath.join(paths["href"], href),
"rel": "stylesheet",
}
)

scripts = deepcopy(self.script)
for s in scripts:
src = urllib.parse.quote(s["src"])
s.update({"src": os.path.join(paths["href"], src)})
s.update({"src": posixpath.join(paths["href"], src)})

head: Optional[str]
if self.head is None:
Expand Down