question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tables control does not display numbers exceeding 5 digits

See original GitHub issue
  • Markwon version: 4.3.0
  1. Please specify expected/actual behavior

A bit strange, on my OPPO Reno ACE phone, the numbers in the table are not displayed when they exceed 5 digits. But it shows on my Xiaomi 6 phone.

  1. Please specify conditions/steps to reproduce (layout, code, markdown used, etc)

gradle

    implementation "io.noties.markwon:core:4.3.0"
    implementation "io.noties.markwon:image:4.3.0"
    implementation "io.noties.markwon:ext-latex:4.3.0"
    implementation 'io.noties.markwon:ext-strikethrough:4.3.0'
    implementation 'io.noties.markwon:inline-parser:4.3.0'
    implementation 'io.noties.markwon:image-picasso:4.3.0'
    implementation 'io.noties.markwon:ext-tables:4.3.0'
    implementation 'io.noties.markwon:linkify:4.3.0'
    implementation('io.noties.markwon:syntax-highlight:4.3.0') {
        exclude group: 'org.jetbrains'
    }
    implementation 'io.noties.markwon:ext-tasklist:4.3.0'
    implementation 'io.noties.markwon:html:4.3.0'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
    implementation("io.noties:prism4j:2.0.0") {
        exclude group: 'org.jetbrains'
    }
    annotationProcessor 'io.noties:prism4j-bundler:2.0.0'
    implementation 'com.caverock:androidsvg-aar:1.4'

layout

        <ScrollView
            android:id="@+id/scroll_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="20dp"
            android:overScrollMode="never"
            android:scrollbars="none"
            >

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/tv_markdown"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="6dp"
                android:textSize="16sp" />

        </ScrollView>

init

    mMarkwon = Markwon
            .builder(this)
            .usePlugin(StrikethroughPlugin.create())
            .usePlugin(LinkifyPlugin.create())
            .usePlugin(TaskListPlugin.create(DetailMarkdownPlusActivity.this))
            .usePlugin(SyntaxHighlightPlugin.create(new Prism4j(new MyGrammarLocator()), isNightMode() ? Prism4jThemeDarkula.create()
                : Prism4jThemeDefault.create()))
            .usePlugin(HtmlPlugin.create(new HtmlPlugin.HtmlConfigure() {
                @Override
                public void configureHtml(@NonNull HtmlPlugin plugin) {
                    plugin.addHandler(new AlignTagHandler());
                }
            }))
            .usePlugin(TablePlugin.create(new TablePlugin.ThemeConfigure() {
                @Override
                public void configureTheme(@NonNull TableTheme.Builder builder) {
                    boolean nightMode = isNightMode();
                    builder
                        .tableBorderWidth(1)
                        .tableEvenRowBackgroundColor(Color.parseColor(nightMode ? "#4Dcccccc" : "#4D9EBCE2"))
                        .tableOddRowBackgroundColor(Color.parseColor(nightMode ? "#2Dcccccc" : "#2D9EBCE2"))
                        .tableCellPadding(DisplayUtils.dip2px(4));
                }
            }))
            .usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() {
                @Override
                public void configureImages(@NonNull ImagesPlugin plugin) {
                    plugin.addSchemeHandler(FileSchemeHandler.create());
                    plugin.addSchemeHandler(OkHttpNetworkSchemeHandler.create());
                }
            }))
            .usePlugin(PicassoImagesPlugin.create(Picasso.get()))
            .usePlugin(new AbstractMarkwonPlugin() {
                @Override
                public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
                    super.beforeSetText(textView, markdown);
                    AsyncDrawableScheduler.unschedule(textView);
                }
                
                @Override
                public void afterSetText(@NonNull TextView textView) {
                    super.afterSetText(textView);
                    AsyncDrawableScheduler.schedule(textView);
                }
            })
            .usePlugin(MarkwonInlineParserPlugin.create())
            .usePlugin(JLatexMathPlugin.create(mEtMarkdown.getTextSize(), new JLatexMathPlugin.BuilderConfigure() {
                @Override
                public void configureBuilder(@NonNull JLatexMathPlugin.Builder builder) {
                    builder.inlinesEnabled(true);
                }
            }))
            .build();

usage

        Observable.just(content)
            .map(new Function<String, Spanned>() {
                @Override
                public Spanned apply(String s) throws Exception {
                    return mMarkwon.toMarkdown(s);
                }
            })
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .as(AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(DetailMarkdownPlusActivity.this)))
            .subscribe(new Consumer<Spanned>() {
                @Override
                public void accept(Spanned str) throws Exception {
                    if (mMarkwon != null && mTvMarkdown != null && str != null) {
                        mMarkwon.setParsedMarkdown(mTvMarkdown, str);
                    }
                }
            }, Throwable :: printStackTrace);

when > 4 digits

before

Screenshot_2020-03-28-13-44-56-46_6db4d030f3e82ab

after

IMG_20200328_134510

when <= 4 digits

Screenshot_2020-03-28-14-17-59-13_6db4d030f3e82ab

others

  1. I tried removing the margin of the ScrollView, but it didn’t work.
  2. I tried removing the cell padding of the Table Plugin, but it didn’t work.

so i have no idea how to solve this problem. can you help me ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
notiescommented, Mar 29, 2020

It is actually a bug in ext-tables because of which links are not displayed properly

1reaction
notiescommented, Mar 28, 2020

Glad I could help @zhouzhuo810 🙌 !

Still I would like to keep this issue open until I investigate why tables are not displaying linkified content

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set the field size - Microsoft Support
If the field contains data When you change the field size, Access truncates all the values in the field that exceed the specified...
Read more >
php: quickest way to generate a 5-digit number not already in ...
Pre-populate your table and add a column to indicate that a number is unused. Select an unused number using LIMIT = 1 and...
Read more >
Chapter 3. Data, Tables, and Database Design - O'Reilly
The Precision property sets the total number of digits that will be stored on both sides of the decimal point. Its maximum is...
Read more >
How do I change the number display from scientific notation to ...
If the goal is to output enough digits to be able to transfer the values exactly in text form, then format long g...
Read more >
Add auto-numbering records in a table - ServiceNow Docs
The number of digits can exceed the minimum length. For example, if Number of digits is 2 and more than 99 records are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found