<commit_before>{$} = require 'atom-space-pen-views'
{Task} = require 'atom'
path = require 'path'
fs = require 'fs-plus'
cheerio = require 'cheerio'
# No direct dependence with Highlight because it requires a compilation. See #63 and #150 and atom/highlights#36.
Highlights = require path.join atom.packages.resolvePackagePath('markdown-preview'), '..', 'highlights'
{scopeForFenceName} = require './highlights-helper'

{makeAttributes, makeOptions} = require './configuration-builder'

highlighter = null
{resourcePath} = atom.getLoadSettings()
packagePath = path.dirname(__dirname)

exports.toHtml = (text='', filePath) ->
  render text, filePath
    .then (html) ->
      sanitize html
    .then (html) ->
      resolveImagePaths html, filePath
    .then (html) -><commit_msg>fix: Highlights with RPM made for Fedora by the Fedora community. (#228)<commit_after>{$} = require 'atom-space-pen-views'
{Task} = require 'atom'
path = require 'path'
fs = require 'fs-plus'
cheerio = require 'cheerio'

# No direct dependence with Highlight because it requires a compilation. See #63 and #150 and atom/highlights#36.
markdownPreviewPath = atom.packages.resolvePackagePath 'markdown-preview'
commonHighlightsPath = path.join markdownPreviewPath, '..', 'highlights'
if fs.isDirectorySync commonHighlightsPath
  Highlights = require commonHighlightsPath
else
  # Fix specific problem with RPM made for Fedora by the Fedora community. See #226.
  Highlights = require path.join markdownPreviewPath, 'node_modules', 'highlights'

{scopeForFenceName} = require './highlights-helper'

{makeAttributes, makeOptions} = require './configuration-builder'

highlighter = null
{resourcePath} = atom.getLoadSettings()
packagePath = path.dirname(__dirname)

exports.toHtml = (text='', filePath) ->
  render text, filePath
    .then (html) ->
      sanitize html
    .then (html) ->
      resolveImagePaths html, filePath
    .then (html) ->
{'fraction_non_alphanumeric': 0.11966701352757544, 'fraction_numerical': 0.01040582726326743, 'mean_word_length': 4.655882352941177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3905688', 'n_tokens_mistral': 582, 'n_tokens_neox': 568, 'n_words': 172}