目录

How do I properly render the returned HTML containing mathematical formulas to the page?

Currently, HarmonyOS does not provide a dedicated mathematical formula rendering component. You can use the WebView component to load web pages that support mathematical formula rendering.

The sample code is as follows:

import { webview } from "@kit.ArkWeb"

@Component
export struct CourseLearning {
  private webviewController: webview.WebviewController = new webview.WebviewController();

  build() {
    Column() {
      Web({ src: $rawfile('Mathematics.html'), controller: this.webviewController })
        .domStorageAccess(true)
        .javaScriptAccess(true)
    }
  }
}

For details about the HTML provided in the sample code, see Mathematics.html.