Passed
Pull Request — develop (#110)
by inkhey
02:39 queued 01:04
created

backend.tracim_backend.lib.utils.markup_conversion   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A convert_to_another_markup() 0 10 3
1
TEXT_MARKUP = 'text'
2
HTML_MARKUP = 'html'
3
4
5
def convert_to_another_markup(
6
        content,
7
        input_markup: str,
8
        output_markup: str,
9
) -> str:
10
    # TODO - G.M - 2018-10-29 - Support for html content, deal correctly
11
    # with line break.
12
    if input_markup == TEXT_MARKUP and output_markup == HTML_MARKUP:
13
        content = content.replace('\n', '<br/>')
14
    return content
15