INNER CODE UNIT · Python

escape_cell

introlab/rtabmap · doxygen/generate_parameters_page.py:226

def escape_cell(text):
    """A table cell cannot contain a raw '|', and '<' would open an HTML tag."""
    return text.replace('|', '\\|').replace('<', '&lt;').replace('>', '&gt;')


def format_defaults(param):
    def code(value):
        value = value.strip()
        return '`%s`' % value if value else '`""`'

    # Consecutive branches giving the same value are merged, so that a value
    # that only changes in the last #else does not repeat three times.
    merged = []
    for value, branch in param.defaults:
        if merged and merged[-1][0] == value:
            merged[-1][1].append(branch)
        else:
            merged.append([value, [branch]])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…