private void fixSpannedWithSpaces(SpannableStringBuilder builder, int widthMeasureSpec,
                                      int heightMeasureSpec) {
        long startFix = System.currentTimeMillis();

        FixingResult result = addSpacesAroundSpansUntilFixed(builder, widthMeasureSpec,
                heightMeasureSpec);

        if (result.fixed) {
            removeUnneededSpaces(widthMeasureSpec, heightMeasureSpec, builder, result);
        } else {
            fallbackToString(widthMeasureSpec, heightMeasureSpec);
        }

        if (HtmlTextView.DEBUG) {
            long fixDuration = System.currentTimeMillis() - startFix;
            Log.d(HtmlTextView.TAG, "fixSpannedWithSpaces() duration in ms: " + fixDuration);
        }
    }
Add spaces around spans until the text is fixed, and then removes the unneeded spaces
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/html/JellyBeanSpanFixTextView.java