xgi / houdoku

Manga reader and library manager for the desktop
https://houdoku.org
MIT License
727 stars 39 forks source link

html encoding in anilist description #291

Open pingu6 opened 1 year ago

pingu6 commented 1 year ago

Acknowledgements

Houdoku version

2.13.0

Operating system

Windows 10

Steps to reproduce

Houdoku_7pMfBUODnK

note it only show in the trackers search

Expected behavior

description without html ig?

Actual behavior

Houdoku_pMzSbkZBLO

Log files

No response

Additional information (optional)

No response

Sajid2001 commented 10 months ago

I was able to fix this bug.

Code changes (v2.13.0)

[./services/trackers/anilist.ts lines 147-153] - (Removes the html tags inside the description)

        const regex = /(<([^>]+)>)/gi;
        return data.data.Page.media.map((media: any) => ({
          id: media.id,
          title: media.title.romaji,
          description: media.description === null ? '' : media.description.replace(regex,""),
          coverUrl: media.coverImage.large,
        }));

Before

image

After

image

[./src/components/library/tracker/SeriesTrackerModalTab.tsx lines 311-322] - (Clicking on Settings in Tracker modal redirects to the Settings tab)

 const renderTrackerContent = (trackerMetadata: TrackerMetadata) => {
    if (!username) {
      return (
        <Text mt="xs">
          In order to track this series, please link your {trackerMetadata.name} account through the{' '}
          <Anchor onClick={() => navigate('/Settings')} component="span" color="blue" weight={700}>
            Settings
          </Anchor>{' '}
          tab.
        </Text>
      );
    }

image

@xgi Where can I push these changes for review? (I am a new to this project)