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

好讀模式在有自動換行的文章顯示錯誤 #39

Open
tomchentw opened this issue Mar 3, 2018 · 3 comments
Open

好讀模式在有自動換行的文章顯示錯誤 #39

tomchentw opened this issue Mar 3, 2018 · 3 comments
Assignees
Labels

Comments

@tomchentw
Copy link
Collaborator

如圖,網址在: https://www.ptt.cc/bbs/joke/M.1398913173.A.DDE.html
進板搜尋:「臉書強迫」

www.ptt.cc

screen shot 2018-03-03 at 3 28 53 pm

term.ptt.cc

screen shot 2018-03-03 at 3 28 47 pm

@tomchentw
Copy link
Collaborator Author

tomchentw commented Mar 3, 2018

@robertabcd

  isTextWrappedRow: function(row) {
    // determine whether it is wrapped by looking for the ending "\"
    var rowText = this.getRowText(row, 0, this.cols);
    var slashIndex = rowText.lastIndexOf('\\');
    if (slashIndex > 0 ) {
      var col = u2b(rowText.substr(0, slashIndex)).length;
      if (col != 77 && col != 78) return false;
      // check the color
      var ch = this.lines[row][col];
      if (ch.fg == 7 && ch.bg === 0 && ch.bright)
        return true;
    }
    return false;
  },

在自動換行的情境下,該行似乎不會出現 '\\' 自然也不會被認為是「wrapped row」,因此好讀模式下的行數索引就錯誤了 QQ

我不是很清楚現行機制下要如何辨識該行是「自動換行」的行?目前正在改版的扣裡面,我可以讓他至少顯示所有內容(雖然無法辨認哪些行數是重複的),可能這樣就可以把 isTextWrappedRow 拔掉……

@IepIweidieng

This comment was marked as outdated.

@IepIweidieng
Copy link
Contributor

IepIweidieng commented Nov 28, 2022

在 pmore 文章瀏覽器中,需從 o 鍵選單同時設定「斷行方式:自動斷行」與「斷行符號:顯示」,才會在自動換行的行末顯示換行符號 \
(PttBBS 的預設設定是「斷行方式:自動換行」與「斷行符號:顯示」)

然而,由於 isTextWrappedRow() 假設畫面寬度固定爲 80,目前即使顯示換行符號,在寬畫面下的判斷也會不正確。

Screenshot_20221129-000304_Edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants