<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi, there.<div><br></div><div>There has to be a way to allow manual styling in workspaces. This doesn't do it:</div><div><br></div><div><img src="cid:1404af3b-7074-4941-a6a3-25cb08aeb95e" width="auto"></img></div><div><br></div><div>Yeah, I have no idea, why #unstyledTextFrom: keeps so many attributes. Has been this way like forever:</div><div><br></div><div><img src="cid:39c362b7-1cf4-4782-bed1-1e58e6487250" width="auto"></img></div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 06.08.2019 14:41:19 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>ok, I assumed #updateStyle would be only sent if styling is active, but I was wrong. I knew this handy styling shortcut before, and just found out that your proposed condition maybe would not be sufficient: As Shout preserves some styles (for example TextDoIts),
 it would be a pity to delete them when you disable syntax highlighting in Workspace. This is also what happens in Squeak-5.2<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">,
 so I would like to keep </span><span id="ms-rterangepaste-start" style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px"></span><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">Tools-ct.867</span>.</p>
<p><br>
</p>
<p>Just one proposal to solve this:<span></span></p>
<p><br>
</p>
<p></p>
<div>updateStyleNow</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>styler ifNil: [^ self].</div>
<div><span style="white-space:pre"></span>self okToStyle</div>
<div><span style="white-space:pre"></span>ifTrue: [styler style: textMorph contents]</div>
<div><span style="white-space:pre"></span>ifFalse: [textMorph contents: (styler unstyledTextFrom: textMorph contents)].</div>
<div><br>
</div>
<div>(#updateStyle analogously)</div>
<div><br>
</div>
<div>This preserves custom stylings when you toggle styling in Workspace.</div>
<div><br>
</div>
<div>---</div>
<div><br>
</div>
<div>It still does not work perfect, I think there are kept too many attributes after toggling styling off:</div>
<div><br>
</div>
<div><img size="4062" contenttype="image/png" id="img433030" style="max-width: 99.9%; user-select: none;" contextid="img580463" tabindex="0" src="cid:982db5da-e636-4aeb-914b-eeabd309f122"></img></div>
<div>(custom attributes: one TextDoIt, one TextURL)</div>
<div>becomes to</div>
<div><img size="4084" contenttype="image/png" id="img415642" style="max-width: 99.9%; user-select: none;" contextid="img401510" tabindex="0" src="cid:5788ce00-d4fb-40e4-bc6d-01ca7c2f88e7"></img><br>
</div>
<div><br>
</div>
<div>I wonder why #unstyledTextFrom: handles all attributes on this binary way? I changed it</div>
<div><br>
</div>
<div>
<div>unstyledTextFrom: aText</div>
<div><span style="white-space:pre"></span>"Re-implemented so that TextActions are not removed from aText"</div>
<div><span style="white-space:pre"></span>| answer |<span style="white-space:pre">
</span></div>
<div><span style="white-space:pre"></span>answer := super unstyledTextFrom: aText.</div>
<div><span style="white-space:pre"></span>aText runs withStartStopAndValueDo: [:start :stop :attribs |</div>
<div>+<span style="white-space:pre"> </span>attribs</div>
<div>+<span style="white-space:pre"> </span>select: [:each | each shoutShouldPreserve]</div>
<div>+<span style="white-space:pre"> </span>thenDo: [:each | answer addAttribute: each from: start to: stop]].</div>
<div>-<span style="white-space:pre"> </span>(attribs anySatisfy: [:each | each shoutShouldPreserve])</div>
<div>-<span style="white-space:pre"> </span>ifTrue: [</div>
<div>-<span style="white-space:pre"> </span>attribs do: [:eachAttrib | answer addAttribute: eachAttrib from: start to: stop]]].</div>
<div><span style="white-space:pre"></span>^answer</div>
</div>
<div><br>
</div>
<div>and it looks like this:</div>
<div><br>
</div>
<div><img size="5123" contenttype="image/png" id="img195432" style="max-width: 99.9%; user-select: none;" contextid="img112808" tabindex="0" src="cid:acb3ae0a-e2e1-42a7-8f3c-a5dc5bbddb2d"></img><br>
</div>
<div><br>
</div>
<div>Are there any reasons for the current implementation of #unstyledTextFrom:? Looking forward to your opinions :)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<p></p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
</div>
</div>
</div>
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b><br>
</b></span></div>
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 6. August 2019 09:22:37<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.234.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph,
<div><br>
</div>
<div>this is not working. We have to support manual styling and cannot just remove text attributes there. Maybe if we check whether "styer" is set. Even then, we should follow the logic in PluggableTextMorphPlus >> #stylerStyled: to remove those text attributes.</div>
<div><br>
</div>
<div>Btw: You can style a piece of text manually via the context menu or [CMD]+[6..0].</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color:#AAAAAA; margin-top:10px">Am 05.08.2019 14:50:20 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of ToolBuilder-Morphic was added to project The Inbox:<br>
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.234.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: ToolBuilder-Morphic-ct.234<br>
Author: ct<br>
Time: 5 August 2019, 2:50:11.900062 pm<br>
UUID: f6987fae-9cfa-4e44-927f-247f4eeb868e<br>
Ancestors: ToolBuilder-Morphic-mt.233<br>
<br>
Extend #updateStyle(Now) to remove obsolete styling<br>
<br>
A call of #updateStyle(Now) implies that the text morph is used for styling, so it is not capable of storing other styles we could accidentally delete here.<br>
<br>
=============== Diff against ToolBuilder-Morphic-mt.233 ===============<br>
<br>
Item was changed:<br>
----- Method: PluggableTextMorphPlus>>updateStyle (in category 'styling') -----<br>
updateStyle<br>
<br>
self okToStyle<br>
+ ifTrue: [styler styleInBackgroundProcess: textMorph contents]<br>
+ ifFalse: [textMorph contents: textMorph contents asString].!<br>
- ifTrue: [styler styleInBackgroundProcess: textMorph contents].!<br>
<br>
Item was changed:<br>
----- Method: PluggableTextMorphPlus>>updateStyleNow (in category 'styling') -----<br>
updateStyleNow<br>
<br>
self okToStyle<br>
+ ifTrue: [styler style: textMorph contents]<br>
+ ifFalse: [textMorph contents: textMorph contents asString].!<br>
- ifTrue: [styler style: textMorph contents].!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</div></blockquote></div>