from typing import List
import re


def solution_detailed(raw: str, markers: List[str]) -> str:
    """Remove all comments from raw string as indicated by markers."""
    if markers:
        cleaned_lines = []
        escaped_markers = r'|'.join(map(re.escape, markers))
        for line in raw.split('\n'):
            cleaned_lines.append(re.split(escaped_markers, line)[0].strip())
        cleaned = '\n'.join(cleaned_lines)
        return cleaned
    return raw