Interface IHtmlContentFetcher
Contract for fetching remote HTML content and extracting the launcher's news fragment from it.
public interface IHtmlContentFetcher
Methods
FetchAndExtract(string, string, Action<HtmlNode>, Action<string>)
Asynchronously fetches HTML from a URL and extracts the element identified by
divClass.
IEnumerator FetchAndExtract(string url, string divClass, Action<HtmlNode> onContentReady, Action<string> onError)
Parameters
urlstringThe URL from which to fetch HTML.
divClassstringThe CSS class of the div element whose content should be extracted.
onContentReadyAction<HtmlNode>Callback invoked with the extracted node on success.
onErrorAction<string>Callback invoked with an error message if fetching or parsing fails.
Returns
- IEnumerator
An IEnumerator for use in a Unity Coroutine.
Remarks
Yields the parsed node rather than formatted text. Formatting is the active view's
responsibility because the two launcher views share no common text format —
TextMeshPro and UI Toolkit disagree on rich-text tag casing and alignment syntax,
and UI Toolkit has no equivalent of TMP's <link> tag at all, so news
links have to become real elements there. See SetNewsContent(HtmlNode).