--- a/modules/pathologic/pathologic.test
+++ b/modules/pathologic/pathologic.test
@@ -32,6 +32,7 @@
     $filter->callback = '_pathologic';
     $filter->settings = array(
       'absolute' => TRUE,
+      'protocol_relative' => FALSE,
       'local_paths' => '',
     );
     $filter->format = 0;
--- a/modules/pathologic/pathologic.module
+++ b/modules/pathologic/pathologic.module
@@ -25,6 +25,7 @@
       'default settings' => array(
         'local_paths' => '',
         'absolute' => TRUE,
+        'protocol_relative' => FALSE,
       ),
       // Set weight to 50 so that it will hopefully appear at the bottom of
       // filter lists by default. 50 is the maximum value of the weight menu
@@ -49,9 +50,16 @@
       '#type' => 'checkbox',
       '#title' => t('Output full absolute URLs'),
       '#default_value' => isset($filter->settings['absolute']) ? $filter->settings['absolute'] : $defaults['absolute'],
-      '#description' => t('If checked, Pathologic will output full absolute URLs, with a protocol and server fragment (such as <code>http://example.com/foo/bar</code>); this is useful if you want images and links to not break for those reading the content in a feed reader or through some other form of aggregation. However, in cases where the site is being served via both HTTP and HTTPS, it may be necessary to uncheck this box so that protocol and server fragments are omitted in the paths Pathologic creates (such as <code>/foo/bar</code>) to avoid issues where the browser complains about pages containing both secure and insecure content.'),
+      '#description' => t('If checked, Pathologic will output full absolute URLs, with a protocol and server fragment (such as <code>http://example.com/foo/bar</code>); this is useful if you want images and links to not break for those reading the content in a feed reader or through some other form of aggregation. However, in cases where the site is being served via both HTTP and HTTPS, it may be necessary to uncheck this box or enable "Modify absolute URLs to be protocol-relative" below to avoid issues where the browser complains about pages containing both secure and insecure content.'),
       '#weight' => 10,
     ),
+    'protocol_relative' => array(
+      '#type' => 'checkbox',
+      '#title' => t('Modify absolute URLs to be protocol-relative'),
+      '#default_value' => isset($filter->settings['protocol_relative']) ? $filter->settings['protocol_relative'] : $defaults['protocol_relative'],
+      '#description' => t('If checked, Pathologic will modify internally-pointing absolute URLs, changing absolute (eg. <code>http://example.com/foo/bar</code>) addresses to protocol-relative variants (eg. <code>//example.com/foo/bar</code>).  Browsers will interpret <code>//example.com</code> as either http: or https: based on the current mode (HTTP or HTTPS), preventing mixed (HTTP/HTTPS) content warnings.  Protocol-relative URLs work well with "Output full absolute URLs" enabled, solving the external feed reader problem without introducing a mixed content issue.'),
+      '#weight' => 15,
+    ),
     'local_paths' => array(
       '#type' => 'textarea',
       '#title' =>  t('All base paths for this site'),
@@ -264,6 +272,32 @@
       'language' => isset($settings['language_list'][$settings['langcode']]) ? $settings['language_list'][$settings['langcode']] : $settings['language_list'][LANGUAGE_NONE],
     )
   );
+  
+  // Replace internally-pointing absolute references with protocol-relative
+  // variants, if that option is enabled:
+  if ($settings['current_settings']['protocol_relative']) {
+    // Note: according to http://api.drupal.org/api/drupal/developer!globals.php/global/base_url/7
+    // the internal URL with scheme (eg. https://) is stored in $GLOBALS['base_url'],
+    // so we'll just use the GLOBALS version.
+    
+    // IF is faster than preg_replace() and preg_quote(), so cache it for future calls:
+    if (!isset($settings['relative_url']) || !isset($settings['absolute_url_regex'])) {
+      $relative_url = preg_replace('/^.+?:/i', '', $GLOBALS['base_url']);
+      $settings['relative_url'] = $relative_url;
+      $absolute_url_regex = '/^' . preg_quote($GLOBALS['base_url'], '/') . '/i';
+      $settings['absolute_url_regex'] = $absolute_url_regex;
+    }
+    else {
+      $relative_url = $settings['relative_url'];
+      $absolute_url_regex = $settings['absolute_url_regex'];
+    }
+    // Replace absolute internal URL with the relative version, use
+    // preg_replace() to limit replacement to the start of the string (we
+    // want to rewrite corner-case query fragments that just happen to have our
+    // absolute URL in them):
+    $url = preg_replace($absolute_url_regex, $relative_url, $url);
+  }
+  
   // $matches[1] will be the tag attribute; src, href, etc.
   return "{$matches[1]}=\"{$url}";
 }
--- a/modules/pathologic/pathologic.install
+++ b/modules/pathologic/pathologic.install
@@ -33,6 +33,7 @@
           'status' => 1,
           'settings' => array(
             'absolute' => variable_get('filter_pathologic_absolute_' . $instance->format, TRUE),
+            'protocol_relative' => FALSE,
             'local_paths' => variable_get('filter_pathologic_local_paths_' . $instance->format, ''),
           ),
         );
