diff --git a/ajax_markup.module b/ajax_markup.module
index 082a069..1dae9d4 100644
--- a/ajax_markup.module
+++ b/ajax_markup.module
@@ -33,6 +33,10 @@ function ajax_markup_access() {
  */
 function ajax_markup() {
   $format = (int) (isset($_POST['format']) ? $_POST['format'] : FILTER_FORMAT_DEFAULT);
+  // Get default node format if better formats is installed.
+  if ($format == FILTER_FORMAT_DEFAULT && function_exists('better_formats_get_default_format')) {
+    $format = (int) better_formats_get_default_format('node');
+  }
   $output = isset($_POST['input']) ? check_markup($_POST['input'], $format, TRUE) : '';
   drupal_json(array('output' => $output));//sets text/javascript header
   exit();
