Update the content attribute. Change all the relative paths of the content to relative paths suitable for the output content. :param content: content resource that will be passed to the templates. :param siteurl: siteurl which is locally generated by the writer in
(self, content: str, siteurl: str)
| 381 | return re.compile(regex, re.X) |
| 382 | |
| 383 | def _update_content(self, content: str, siteurl: str) -> str: |
| 384 | """Update the content attribute. |
| 385 | |
| 386 | Change all the relative paths of the content to relative paths |
| 387 | suitable for the output content. |
| 388 | |
| 389 | :param content: content resource that will be passed to the templates. |
| 390 | :param siteurl: siteurl which is locally generated by the writer in |
| 391 | case of RELATIVE_URLS. |
| 392 | """ |
| 393 | if not content: |
| 394 | return content |
| 395 | |
| 396 | hrefs = self._get_intrasite_link_regex() |
| 397 | return hrefs.sub(lambda m: self._link_replacer(siteurl, m), content) |
| 398 | |
| 399 | def get_static_links(self) -> set[str]: |
| 400 | static_links = set() |
no test coverage detected