Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footer Does Not Resolve Ampersand Symbol #168

Open
MartinPacker opened this issue Sep 18, 2024 · 3 comments
Open

Footer Does Not Resolve Ampersand Symbol #168

MartinPacker opened this issue Sep 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@MartinPacker
Copy link
Owner

Footer populated from Heading Level 2. & shown where & should be.

@MartinPacker MartinPacker added the bug Something isn't working label Sep 18, 2024
@MartinPacker
Copy link
Owner Author

Relevant code - currently at line 425:

def substituteFooterVariables(footerText, liveFooters):
    # Decide if the footer should be a live link to the section slide
    wantLiveFooter = (
        (prs.lastSectionSlide is not None)
        & (footerText.find("<section") > -1)
        & (liveFooters == "yes")
    )

    # Substitute any section title occurrences
    sectionTitleLines = prs.lastSectionTitle.split("<br/>")

    footerText = footerText.replace("<section>", sectionTitleLines[0])
    footerText = footerText.replace("<section1>", sectionTitleLines[0])

    if len(sectionTitleLines) > 1:
        footerText = footerText.replace("<section2>", sectionTitleLines[1])

    if len(sectionTitleLines) > 2:
        footerText = footerText.replace("<section3>", sectionTitleLines[2])

    # Substitute any presentation title occurrences
    presTitleLines = prs.lastPresTitle.split("<br/>")
    footerText = footerText.replace("<presTitle>", presTitleLines[0])
    footerText = footerText.replace("<presTitle1>", presTitleLines[0])

    if len(presTitleLines) > 1:
        footerText = footerText.replace("<presTitle2>", presTitleLines[1])

    if len(presTitleLines) > 2:
        footerText = footerText.replace("<presTitle3>", presTitleLines[2])

    # Substitute any presentation subtitle occurrences
    presSubtitleLines = prs.lastPresSubtitle.split("<br/>")

    footerText = footerText.replace("<presSubtitle>", presSubtitleLines[0])
    footerText = footerText.replace("<presSubtitle1>", presSubtitleLines[0])

    if len(presSubtitleLines) > 1:
        footerText = footerText.replace("<presSubtitle2>", presSubtitleLines[1])

    if len(presSubtitleLines) > 2:
        footerText = footerText.replace("<presSubtitle3>", presSubtitleLines[2])

    # Make newlines happen
    footerText = footerText.replace("<br/>", "\n")

    return footerText, wantLiveFooter

@MartinPacker
Copy link
Owner Author

It's not just the section title but the presentation title that need symbol substitution.

@MartinPacker
Copy link
Owner Author

Fix pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant