--- a/src/libcmd/markdown.cc
+++ b/src/libcmd/markdown.cc
@@ -37,7 +37,13 @@
         .vmargin = 0,
 #  endif
         .feat = LOWDOWN_COMMONMARK | LOWDOWN_FENCED | LOWDOWN_DEFLIST | LOWDOWN_TABLES,
-        .oflags = LOWDOWN_TERM_NOLINK,
+        .oflags =
+#  if HAVE_LOWDOWN_3
+            LOWDOWN_NOLINK
+#  else
+            LOWDOWN_TERM_NOLINK
+#  endif
+        ,
     };

     auto doc = lowdown_doc_new(&opts);
--- a/src/libcmd/meson.build
+++ b/src/libcmd/meson.build
@@ -36,6 +36,7 @@
 configdata.set('HAVE_LOWDOWN', lowdown.found().to_int())
 # The API changed slightly around terminal initialization.
 configdata.set('HAVE_LOWDOWN_1_4', lowdown.version().version_compare('>= 1.4.0').to_int())
+configdata.set('HAVE_LOWDOWN_3', lowdown.version().version_compare('>= 3.0.0').to_int())

 readline_flavor = get_option('readline-flavor')
 if readline_flavor == 'editline'
