from .results import Result
from . import docx, conversion, style_reader


def convert_to_html(fileobj):
    return docx.read(fileobj).bind(lambda document: 
        conversion.convert_document_element_to_html(document, styles=_create_default_styles())
    )


def _create_default_styles():
    lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n")))
    return map(style_reader.read_style, lines)

_default_styles = """
p:unordered-list(1) => ul > li:fresh
"""

from .results import Result
from . import docx, conversion, style_reader


def convert_to_html(fileobj):
    return docx.read(fileobj).bind(lambda document: 
        conversion.convert_document_element_to_html(document, styles=_create_default_styles())
    )


def _create_default_styles():
    lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n")))
    return map(style_reader.read_style, lines)

_default_styles = """
p.Heading1 => h1:fresh
p.Heading2 => h2:fresh
p.Heading3 => h3:fresh
p.Heading4 => h4:fresh
p:unordered-list(1) => ul > li:fresh
p:unordered-list(2) => ul|ol > li > ul > li:fresh
p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh
p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
p:ordered-list(1) => ol > li:fresh
p:ordered-list(2) => ul|ol > li > ol > li:fresh
p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh
p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
"""

Add full list of default styles
Add full list of default styles

  from .results import Result
  from . import docx, conversion, style_reader
  
  
  def convert_to_html(fileobj):
      return docx.read(fileobj).bind(lambda document: 
          conversion.convert_document_element_to_html(document, styles=_create_default_styles())
      )
  
  
  def _create_default_styles():
      lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n")))
      return map(style_reader.read_style, lines)
  
  _default_styles = """
+ p.Heading1 => h1:fresh
+ p.Heading2 => h2:fresh
+ p.Heading3 => h3:fresh
+ p.Heading4 => h4:fresh
  p:unordered-list(1) => ul > li:fresh
+ p:unordered-list(2) => ul|ol > li > ul > li:fresh
+ p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh
+ p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
+ p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
+ p:ordered-list(1) => ol > li:fresh
+ p:ordered-list(2) => ul|ol > li > ol > li:fresh
+ p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh
+ p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
+ p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
  """
  
Add full list of default styles
## Code Before:
from .results import Result
from . import docx, conversion, style_reader


def convert_to_html(fileobj):
    return docx.read(fileobj).bind(lambda document: 
        conversion.convert_document_element_to_html(document, styles=_create_default_styles())
    )


def _create_default_styles():
    lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n")))
    return map(style_reader.read_style, lines)

_default_styles = """
p:unordered-list(1) => ul > li:fresh
"""

## Instruction:
Add full list of default styles
## Code After:
from .results import Result
from . import docx, conversion, style_reader


def convert_to_html(fileobj):
    return docx.read(fileobj).bind(lambda document: 
        conversion.convert_document_element_to_html(document, styles=_create_default_styles())
    )


def _create_default_styles():
    lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n")))
    return map(style_reader.read_style, lines)

_default_styles = """
p.Heading1 => h1:fresh
p.Heading2 => h2:fresh
p.Heading3 => h3:fresh
p.Heading4 => h4:fresh
p:unordered-list(1) => ul > li:fresh
p:unordered-list(2) => ul|ol > li > ul > li:fresh
p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh
p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh
p:ordered-list(1) => ol > li:fresh
p:ordered-list(2) => ul|ol > li > ol > li:fresh
p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh
p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh
"""
