Skip to content

Weird behavior of long links #488

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

Closed
amanokerim opened this issue Jan 13, 2021 · 3 comments
Closed

Weird behavior of long links #488

amanokerim opened this issue Jan 13, 2021 · 3 comments

Comments

@amanokerim
Copy link

amanokerim commented Jan 13, 2021

I use this awesome package in my news app. Version 1.1.1

When the length of a link is longer than the width of a screen then links don't split as expected. The link in the image below should start in the second line and words after the link should not start with a new line. In other words, there is a problem with the splitting of long links:

weird split of the long links

HTML of the image above:

<p style="text-align:justify">В начале 2019 года была запущена английская версия сайта, а осенью того же года на сайте появился отдельный <a href="https://turkmenportal.com/blog/22186/na-saite-turkmenportal-poyavilsya-razdel-s-videomaterialami">медиа-раздел</a>. В нём публикуются не только фоторепортажи, но и видеоматериалы &mdash; видеорепортажи, видеоинтервью и т. д.</p> <p style="text-align:justify">В июле 2019 представитель &laquo;Туркменпортала&raquo; <a href="https://turkmenportal.com/blog/20508/predstavitel-turkmenportala-vpervye-prinyal-uchastie-v-centralnoaziatskoi-konferencii-obse-po-svobode-smi">впервые принял участие в XXI конференции ОБСЕ</a> по вопросам свободы СМИ в Центральной Азии в Бишкеке (Кыргызстан). В своём выступлении корреспондент рассказал о достижениях туркменской цифровой журналистики и об успехах сайта &laquo;Туркменпортал&raquo;.</p>

<p style="text-align:justify">В новом, 2021 году в App Store и Google Play появилось <a href="https://turkmenportal.com/blog/33305/mobilnoe-prilozhenie-turkmenportal-poyavilos-v-app-store-i-google-play">мобильное приложение &laquo;Туркменпортал&raquo;</a>. Для большего удобства функционал нового приложения проще, чем на сайте. Пользователю предоставляется возможность использовать все возможное рабочее пространство экрана мобильного устройства для комфортного чтения и просмотра новостей. Здесь представлены 4 раздела: &laquo;Новости&raquo;, &laquo;Статьи&raquo;, &laquo;Медиа&raquo;, &laquo;Афиша&raquo;.</p>

In the image below a dot should be placed after the link, not in the next line:

dot after the link

HTML of image above:

<p style="text-align: justify;">Ранее мы сообщали, что <a href="https://turkmenportal.com/blog/32903/v-prigorode-balkanabata-planiruyut-postroit-novyi-aeroport">в пригороде Балканабата планируют построить новый аэропорт</a>.</p> 

P.S. Thank you for the great package!

@erickok
Copy link
Contributor

erickok commented Jan 13, 2021

Please provide the HTML you use and state the flutter_html version you use, so we can try to reproduce it.

@amanokerim
Copy link
Author

Please provide the HTML you use and state the flutter_html version you use, so we can try to reproduce it.

Thanks for the quick repIy, edited the issue.

@erickok
Copy link
Contributor

erickok commented Jan 15, 2021

Actually a duplicate of #388. I have a fix ready.

@erickok erickok closed this as completed Jan 15, 2021
erickok added a commit to vrtdev/flutter_html that referenced this issue Jan 15, 2021
If non-text elements are used inside the <a> we still need widget spans and if they are long you can still have clunky wrapping, but I'm not even sure that is a bug per se.

Fixes Sub6Resources#388, Sub6Resources#488 and Sub6Resources#495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants