{% macro wrap_model_string(doc_string, wrap_string, suffix_string="") %}
{# Check if this is a sphinx documentation line that should not have extra prefix spacing #}
{%- set is_sphinx_doc = doc_string.strip().startswith(':ivar') or doc_string.strip().startswith(':vartype') or doc_string.strip().startswith(':param') or doc_string.strip().startswith(':type') -%}
{# Custom handling for bullet points - normalization is now done in preprocessing #}
{% set enable_custom_handling = "\n* " in doc_string or doc_string.startswith("* ") %}
{%- if enable_custom_handling -%}
    {%- set lines = doc_string.split('\n') -%}
    {%- set base_indent = wrap_string.lstrip('\n') -%}
    {%- set result_lines = [] -%}
    {%- for line in lines -%}
        {%- if line.startswith('* ') -%}
            {# Handle bullet points with proper continuation alignment #}
            {%- set bullet_content = line[2:] -%}
            {%- set bullet_line = base_indent + ' * ' + bullet_content -%}
            {%- set continuation_spaces = base_indent + '   ' -%}
            {%- set wrapped = bullet_line | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n' + continuation_spaces) -%}
            {%- set _ = result_lines.append(wrapped) -%}
        {%- elif line.strip() -%}
            {%- set line_indent = '' if line.strip().startswith(':') or loop.index == 1 else (base_indent + ' ') -%}
            {%- set wrapped = (line_indent + line) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring=wrap_string) -%}
            {%- for line in wrapped.split('\n') -%}
            {%- set prefix = "" if loop.index == 1 else " " -%}
            {%- set _ = result_lines.append(prefix + line) -%}
            {%- endfor -%}
        {%- else -%}
            {# Do not add continuous blank lines #}
            {%- if (result_lines and result_lines[-1] != '') or not result_lines -%}
              {%- set _ = result_lines.append('') -%}
            {%- endif -%}
        {%- endif -%}
    {%- endfor -%}
    {%- set original_result = result_lines | join('\n') -%}
{%- else -%}
    {# Regular text handling #}
    {%- set original_result = doc_string | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring=wrap_string) -%}
{%- endif -%}
{% set list_result = original_result.split('\n') %}
{% for line in list_result %}
    {%- if is_sphinx_doc and enable_custom_handling -%}
        {%- set prefix = "" -%}
    {%- else -%}
        {%- set prefix = "" if loop.index == 1 else " " -%}
    {%- endif -%}
    {% set suffix = suffix_string if list_result | length == loop.index %}
{{ prefix }}{{ line }}{{ suffix }}
{% endfor %}
{% endmacro %}