Skip to content

Commit

Permalink
markup doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed May 11, 2024
1 parent 9e6368f commit 4d55b17
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jcvi/graphics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

import copy
import os.path as op
from os import remove

import re
import sys

from os import remove

from functools import partial
from typing import Optional, List, Tuple, Union

Expand Down Expand Up @@ -408,11 +409,12 @@ def fontprop(ax, name, size=12):
return prop


def markup(s):
def markup(s: str):
"""
Change the string to latex format, and italicize the text between *.
"""
if "$" in s:
return s
import re

s = latex(s)
s = re.sub(r"\*(.*)\*", r"\\textit{\1}", s)
return s
Expand Down

0 comments on commit 4d55b17

Please sign in to comment.