Files
Agrendalath 71fee4a4a0 feat!: remove block handling from runtime initialization of ReplaceURLService
BREAKING CHANGE: This removes the following deprecated shims from the runtime:
`replace_urls`, `replace_course_urls`, `replace_jump_to_id_urls`. XBlocks need
to use the `replace_urls` service instead.
2023-06-21 20:28:24 +02:00

13 lines
493 B
Python

"""
Wrapper function to replace static/course/jump-to-id URLs in XBlock to absolute URLs
"""
from openedx.core.lib.xblock_utils import wrap_fragment
def replace_urls_wrapper(block, view, frag, context, replace_url_service, static_replace_only=False): # pylint: disable=unused-argument
"""
Replace any static/course/jump-to-id URLs in XBlock to absolute URLs.
"""
return wrap_fragment(frag, replace_url_service(xblock=block).replace_urls(frag.content, static_replace_only))